Browse Source

修复一个配方不同炒锅同时炒制问题

炒锅机器人_一拖四_带投料
liup 4 days ago
parent
commit
525a1af077
20 changed files with 839 additions and 222 deletions
  1. +4
    -12
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  3. +21
    -5
      app/src/main/java/com/bonait/bnframework/common/db/util/OrderDetailUtil.java
  4. +2
    -0
      app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java
  5. +85
    -20
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodInfoDialog.java
  6. +8
    -8
      app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog.java
  7. +159
    -45
      app/src/main/java/com/bonait/bnframework/newui/dialog/control/FoodPosSetDialog.java
  8. +215
    -47
      app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeOrderFragment.java
  9. +39
    -2
      app/src/main/java/com/bonait/bnframework/newui/widget/FoodPosSetView.java
  10. +5
    -0
      app/src/main/res/drawable/bg_round25_gray.xml
  11. +22
    -0
      app/src/main/res/drawable/bg_wok_select.xml
  12. +6
    -0
      app/src/main/res/drawable/color_text_wok_select.xml
  13. +28
    -0
      app/src/main/res/layout/new/layout/dialog_food_info.xml
  14. +216
    -69
      app/src/main/res/layout/new/layout/dialog_food_pos_set.xml
  15. +2
    -2
      app/src/main/res/layout/new/layout/dialog_root_tip.xml
  16. +12
    -9
      app/src/main/res/layout/new/layout/view_food_pos_set.xml
  17. +9
    -0
      app/src/main/res/layout/svg/drawable/ic_true.xml
  18. +3
    -0
      app/src/main/res/values/colors.xml
  19. +1
    -1
      app/src/main/res/values/strings.xml
  20. +1
    -1
      build.gradle

+ 4
- 12
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -72,20 +72,16 @@ public class ExecuteTheRecipe {
ArrayList<BPA_GOODS_PROCESS_DETAIL> goodsrecipes = GoodsProcessDetailDBUtil.getByGroupId(orderDetail.groupId);
if(orderDetail.deviceNum ==1){
Wok1ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
ConfigName.goodsProcess1.clear();
ConfigName.goodsProcess1.addAll(goodsrecipes);
goodsrecipes = ConfigName.goodsProcess1;
}else if(orderDetail.deviceNum ==2){
Wok2ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
ConfigName.goodsProcess2.clear();
ConfigName.goodsProcess2.addAll(goodsrecipes);
goodsrecipes = ConfigName.goodsProcess2;
}else if(orderDetail.deviceNum ==3){
Wok3ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
ConfigName.goodsProcess3.clear();
ConfigName.goodsProcess3.addAll(goodsrecipes);
goodsrecipes = ConfigName.goodsProcess3;
}else if(orderDetail.deviceNum ==4){
Wok4ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
ConfigName.goodsProcess4.clear();
ConfigName.goodsProcess4.addAll(goodsrecipes);
goodsrecipes = ConfigName.goodsProcess4;
}
int m = 0;
if(!goodsrecipes.isEmpty()){
@@ -174,16 +170,12 @@ public class ExecuteTheRecipe {
WritePLC(orderDetail.deviceNum,"暂停开关", false, null);
Make位置(orderDetail.deviceNum,"原点位");
if(orderDetail.deviceNum ==1){
ConfigName.goodsProcess1.clear();
Wok1ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}else if(orderDetail.deviceNum ==2){
ConfigName.goodsProcess2.clear();
Wok2ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}else if(orderDetail.deviceNum ==3){
ConfigName.goodsProcess3.clear();
Wok3ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}else if(orderDetail.deviceNum ==4){
ConfigName.goodsProcess4.clear();
Wok4ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}



+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java View File

@@ -109,7 +109,7 @@ public class ConfigName {
*/
public String Key = "be992a44-d6a8-462d-8206-3c7998fa944b";

public static String dataPath = "/hbldbWokRobot";
public static String dataPath = "/hbldbWokRobot14";


public String oven_wendu="0";


+ 21
- 5
app/src/main/java/com/bonait/bnframework/common/db/util/OrderDetailUtil.java View File

@@ -127,14 +127,13 @@ public class OrderDetailUtil {

public static BPA_ORDER_DETAIL resetOrder() {
String orderby = QueryDB.Desc_Time_Up;
String where = "isDelete=? and status!=0";
String where = "isDelete=?";
String[] args = new String[]{"0"};
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_DETAIL.class, where, args, orderby);
for (Object k : obj) {
if(((BPA_ORDER_DETAIL) k).status!=0){
((BPA_ORDER_DETAIL) k).status=0;
update((BPA_ORDER_DETAIL) k);
}
((BPA_ORDER_DETAIL) k).status=0;
((BPA_ORDER_DETAIL) k).deviceNum=0;
update((BPA_ORDER_DETAIL) k);
}
return obj.size() > 0 ? (BPA_ORDER_DETAIL) obj.get(0) : null;
}
@@ -170,4 +169,21 @@ public class OrderDetailUtil {
}
return data;
}

public static List<BPA_ORDER_DETAIL> getByFilterMaking(int deviceNum ,int mainPosition) {
String orderby = QueryDB.Desc_Time_Up;
String where = "isDelete=? and status!=0 and deviceNum!=0 and deviceNum!=? and mainPosition=?";
String[] args = new String[]{"0",deviceNum+"",mainPosition+""};
ArrayList<BPA_ORDER_DETAIL> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_DETAIL.class, where, args, orderby);
for (Object k : obj) {
if(((BPA_ORDER_DETAIL) k).status!=0){
data.add(0,(BPA_ORDER_DETAIL) k);
}else {
data.add((BPA_ORDER_DETAIL) k);
}
}
LogUtils.d("OrderDetailUtil getByAllMaking data=" + data.toString());
return data;
}
}

+ 2
- 0
app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java View File

@@ -352,6 +352,8 @@ public class MainHActivity extends BaseActivity {
ModbusCenter.closePLC();
ExecuteTheRecipe.reset1(1);
ExecuteTheRecipe.reset1(2);
ExecuteTheRecipe.reset1(3);
ExecuteTheRecipe.reset1(4);
OrderDetailUtil.resetOrder();
}
}

+ 85
- 20
app/src/main/java/com/bonait/bnframework/newui/dialog/check/FoodInfoDialog.java View File

@@ -18,6 +18,7 @@ import androidx.fragment.app.DialogFragment;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_DETAIL;
import com.bonait.bnframework.common.db.util.GoodsProcessDetailDBUtil;
@@ -30,6 +31,7 @@ import com.bonait.bnframework.databinding.DialogFoodInfoBinding;
import com.bonait.bnframework.databinding.DialogFoodPosSelectBinding;
import com.bonait.bnframework.newui.adapter.order.WokNameAdapter;
import com.bonait.bnframework.newui.adapter.other.FoodPosSelectAdapter;
import com.bonait.bnframework.newui.widget.NewToastUtil;

import java.util.ArrayList;
import java.util.Arrays;
@@ -44,6 +46,7 @@ public class FoodInfoDialog extends DialogFragment {
private String TAG = " FoodInfoDialog =>";
private DialogFoodInfoBinding viewBinding;
private String orderId = "";
private boolean showBack = false;
private BPA_ORDER_DETAIL orderDetail;

@Override
@@ -95,11 +98,19 @@ public class FoodInfoDialog extends DialogFragment {
AdbCommandUtil.hideStatusBar(true);
if (getArguments() != null) {
orderId = getArguments().getString("orderId");
showBack = getArguments().getBoolean("showBack");
}
initView();
}

private void initView(){
viewBinding.btnBack.setVisibility(showBack?View.VISIBLE:View.GONE);
viewBinding.btnBack.setOnClickListener(v->{
if(listener!=null){
listener.clickListenerNew(null,0,null);
dismiss();
}
});
viewBinding.btnClose1.setOnClickListener(v->{
dismiss();
});
@@ -127,6 +138,24 @@ public class FoodInfoDialog extends DialogFragment {
dismiss();
return;
}
viewBinding.tvTip.setVisibility(orderDetail.status!=0?View.VISIBLE:View.GONE);
viewBinding.tvTip.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("正在制作中,无法修改位置");
});
List<BPA_GOODS_PROCESS_DETAIL> details = GoodsProcessDetailDBUtil.getByGroupId(orderDetail.groupId);
if(orderDetail.deviceNum ==1){
details.clear();
details.addAll(ConfigName.goodsProcess1);
}else if(orderDetail.deviceNum ==2){
details.clear();
details.addAll(ConfigName.goodsProcess2);
}else if(orderDetail.deviceNum ==3){
details.clear();
details.addAll(ConfigName.goodsProcess3);
}else if(orderDetail.deviceNum ==4){
details.clear();
details.addAll(ConfigName.goodsProcess4);
}
if(orderDetail.mainPosition!=0 && orderDetail.deviceNum !=0){
switch (orderDetail.mainPosition){
case 1:
@@ -149,7 +178,6 @@ public class FoodInfoDialog extends DialogFragment {
break;
}
}
List<BPA_GOODS_PROCESS_DETAIL> details = GoodsProcessDetailDBUtil.getByGroupId(orderDetail.groupId);
for(BPA_GOODS_PROCESS_DETAIL detail:details){
if(detail.processname.equals("辅料")){
if(!detail.processvalue.isEmpty()){
@@ -257,24 +285,24 @@ public class FoodInfoDialog extends DialogFragment {
showFuLiaoDialog("辅料位置","F8");
});

viewBinding.mainFood1.setOnClickListener(v->{
showMainFoodDialog("主料位置",1);
});
viewBinding.mainFood2.setOnClickListener(v->{
showMainFoodDialog("主料位置",2);
});
viewBinding.mainFood3.setOnClickListener(v->{
showMainFoodDialog("主料位置",3);
});
viewBinding.mainFood4.setOnClickListener(v->{
showMainFoodDialog("主料位置",4);
});
viewBinding.mainFood5.setOnClickListener(v->{
showMainFoodDialog("主料位置",5);
});
viewBinding.mainFood6.setOnClickListener(v->{
showMainFoodDialog("主料位置",6);
});
// viewBinding.mainFood1.setOnClickListener(v->{
// showMainFoodDialog("主料位置",1);
// });
// viewBinding.mainFood2.setOnClickListener(v->{
// showMainFoodDialog("主料位置",2);
// });
// viewBinding.mainFood3.setOnClickListener(v->{
// showMainFoodDialog("主料位置",3);
// });
// viewBinding.mainFood4.setOnClickListener(v->{
// showMainFoodDialog("主料位置",4);
// });
// viewBinding.mainFood5.setOnClickListener(v->{
// showMainFoodDialog("主料位置",5);
// });
// viewBinding.mainFood6.setOnClickListener(v->{
// showMainFoodDialog("主料位置",6);
// });
}

/**
@@ -329,6 +357,44 @@ public class FoodInfoDialog extends DialogFragment {
detail.processvalue = detail.processvalue.replace(posInfo,"辅料位置,"+positionName);
detail.processms = detail.processms.replace(res2[1],positionName);
}

if(order.deviceNum ==1){
if(!ConfigName.goodsProcess1.isEmpty()){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess1){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}
}else if(order.deviceNum ==2){
if(!ConfigName.goodsProcess2.isEmpty()){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess2){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}
}else if(order.deviceNum ==3){
if(!ConfigName.goodsProcess3.isEmpty()){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess3){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}
}else if(order.deviceNum ==4){
if(!ConfigName.goodsProcess4.isEmpty()){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess4){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}
}
if(GoodsProcessDetailDBUtil.update(detail)){
freshView();
xCom.dismissX();
@@ -370,7 +436,6 @@ public class FoodInfoDialog extends DialogFragment {
WokNameAdapter adapter = new WokNameAdapter(){
@Override
protected void onItemClick(View v, int position) {
orderDetail.deviceNum = Integer.parseInt(mData.get(position).substring(0,1));
orderDetail.mainPosition = mainPosition;
OrderDetailUtil.update(orderDetail);
freshView();


+ 8
- 8
app/src/main/java/com/bonait/bnframework/newui/dialog/check/RootTipDialog.java View File

@@ -150,37 +150,37 @@ public class RootTipDialog extends DialogFragment {
switch (i){
case 1:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen1.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen1.setText(i+"出餐盆:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen1.setTextColor(((Boolean)kongPen)?Color.parseColor("#000000"):Color.parseColor("#EF5362"));
}else {
viewBinding.content2.tvKongPen1.setText("炒锅"+i+"出餐盆:异常");
viewBinding.content2.tvKongPen1.setText(i+"出餐盆:异常");
viewBinding.content2.tvKongPen1.setTextColor(Color.parseColor("#EF5362"));
}
break;
case 2:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen2.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen2.setText(i+"出餐盆:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen2.setTextColor(((Boolean)kongPen)?Color.parseColor("#000000"):Color.parseColor("#EF5362"));
}else {
viewBinding.content2.tvKongPen2.setText("炒锅"+i+"出餐盆:异常");
viewBinding.content2.tvKongPen2.setText(i+"出餐盆:异常");
viewBinding.content2.tvKongPen2.setTextColor(Color.parseColor("#EF5362"));
}
break;
case 3:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen3.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen3.setText(i+"出餐盆:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen3.setTextColor(((Boolean)kongPen)?Color.parseColor("#000000"):Color.parseColor("#EF5362"));
}else {
viewBinding.content2.tvKongPen3.setText("炒锅"+i+"出餐盆:异常");
viewBinding.content2.tvKongPen3.setText(i+"出餐盆:异常");
viewBinding.content2.tvKongPen3.setTextColor(Color.parseColor("#EF5362"));
}
break;
case 4:
if(kongPen instanceof Boolean){
viewBinding.content2.tvKongPen4.setText("炒锅"+i+"出餐盆:有:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen4.setText(i+"出餐盆:"+(((Boolean)kongPen)?"有":"无"));
viewBinding.content2.tvKongPen4.setTextColor(((Boolean)kongPen)?Color.parseColor("#000000"):Color.parseColor("#EF5362"));
}else {
viewBinding.content2.tvKongPen4.setText("炒锅"+i+"出餐盆:异常");
viewBinding.content2.tvKongPen4.setText(i+"出餐盆:异常");
viewBinding.content2.tvKongPen4.setTextColor(Color.parseColor("#EF5362"));
}
break;


+ 159
- 45
app/src/main/java/com/bonait/bnframework/newui/dialog/control/FoodPosSetDialog.java View File

@@ -18,6 +18,7 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_DETAIL;
import com.bonait.bnframework.common.db.util.GoodsProcessDetailDBUtil;
@@ -27,6 +28,7 @@ import com.bonait.bnframework.common.utils.AdbCommandUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogFoodPosSetBinding;
import com.bonait.bnframework.newui.widget.FoodPosSetView;
import com.bonait.bnframework.newui.widget.NewToastUtil;

import java.util.ArrayList;
import java.util.List;
@@ -42,7 +44,6 @@ public class FoodPosSetDialog extends DialogFragment {
private String orderId = "";
private List<BPA_GOODS_PROCESS_DETAIL> materialData = new ArrayList<>();
private int mainPosition;
private int deviceNum;
private BPA_ORDER_DETAIL order;


@@ -98,42 +99,59 @@ public class FoodPosSetDialog extends DialogFragment {
orderId = getArguments().getString("orderId");
}
initView();
viewListener();
}

private void initView(){
viewBinding.btnClose.setOnClickListener(view -> dismiss());
order = OrderDetailUtil.getById(orderId);
if(order==null){
dismiss();
return;
}
mainPosition = order.mainPosition;
materialData.clear();
List<BPA_GOODS_PROCESS_DETAIL> details = GoodsProcessDetailDBUtil.getByGroupId(order.groupId);
for(BPA_GOODS_PROCESS_DETAIL detail:details){
if(detail.processname.equals("辅料")){
materialData.add(detail);
viewBinding.tv2.setText("辅料位置");
}
}
updateView();

List<String> posList = new ArrayList<>();
posList.add("Z1");
posList.add("Z2");
posList.add("Z3");
posList.add("Z4");
posList.add("Z5");
posList.add("Z6");
ArrayAdapter<String> spinnerAdapter3 = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, posList);
spinnerAdapter3.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinnerPosition.setAdapter(spinnerAdapter3);

if(order.mainPosition!=0){
viewBinding.spinnerPosition.setSelection(order.mainPosition-1);
}else {
viewBinding.spinnerPosition.setSelection(0);
viewBinding.tvWok1.setSelected(order.deviceNum==1);
viewBinding.wokImage1.setVisibility(order.deviceNum==1?View.VISIBLE:View.GONE);
viewBinding.tvWok2.setSelected(order.deviceNum==2);
viewBinding.wokImage2.setVisibility(order.deviceNum==2?View.VISIBLE:View.GONE);
viewBinding.tvWok3.setSelected(order.deviceNum==3);
viewBinding.wokImage3.setVisibility(order.deviceNum==3?View.VISIBLE:View.GONE);
viewBinding.tvWok4.setSelected(order.deviceNum==4);
viewBinding.wokImage4.setVisibility(order.deviceNum==4?View.VISIBLE:View.GONE);
viewBinding.tvTip.setVisibility(order.deviceNum == 0?View.VISIBLE:View.GONE);
if(order.deviceNum ==1){
if(!ConfigName.goodsProcess1.isEmpty()){
details.clear();
details.addAll(ConfigName.goodsProcess1);
}
}else if(order.deviceNum ==2){
if(!ConfigName.goodsProcess2.isEmpty()){
details.clear();
details.addAll(ConfigName.goodsProcess2);
}
}else if(order.deviceNum ==3){
if(!ConfigName.goodsProcess3.isEmpty()){
details.clear();
details.addAll(ConfigName.goodsProcess3);
}
}else if(order.deviceNum ==4){
if(!ConfigName.goodsProcess4.isEmpty()){
details.clear();
details.addAll(ConfigName.goodsProcess4);
}
}
mainPosition = Integer.parseInt(viewBinding.spinnerPosition.getSelectedItem().toString().substring(1));
updateView();
}

private void viewListener(){
viewBinding.btnClose.setOnClickListener(view -> dismiss());
viewBinding.spinnerPosition.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
@@ -146,37 +164,135 @@ public class FoodPosSetDialog extends DialogFragment {
}
});

List<String> wokList = new ArrayList<>();
wokList.add("1号炒锅");
wokList.add("2号炒锅");
wokList.add("3号炒锅");
wokList.add("4号炒锅");
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, wokList);
spinnerAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinnerWok.setAdapter(spinnerAdapter);
if(order.deviceNum !=0){
viewBinding.spinnerWok.setSelection(order.deviceNum -1);
viewBinding.flWok1.setOnClickListener(v->{
selectWok(1);
});
viewBinding.flWok2.setOnClickListener(v->{
selectWok(2);
});
viewBinding.flWok3.setOnClickListener(v->{
selectWok(3);
});
viewBinding.flWok4.setOnClickListener(v->{
selectWok(4);
});
viewBinding.tvTip.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("请先选择炒锅位置");
});
}

private void selectWok(int deviceNum){
List<String> posList = new ArrayList<>();
if(order.deviceNum == 2 || order.deviceNum == 3){
posList.add("Z4");
posList.add("Z5");
posList.add("Z6");
}else {
viewBinding.spinnerWok.setSelection(0);
posList.add("Z1");
posList.add("Z2");
posList.add("Z3");
}
deviceNum = Integer.parseInt(viewBinding.spinnerWok.getSelectedItem().toString().substring(0,1));
viewBinding.spinnerWok.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
deviceNum = Integer.parseInt(viewBinding.spinnerWok.getSelectedItem().toString().substring(0,1));
order.deviceNum = deviceNum;
OrderDetailUtil.update(order);

ArrayAdapter<String> spinnerAdapter3 = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, posList);
spinnerAdapter3.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinnerPosition.setAdapter(spinnerAdapter3);
viewBinding.spinnerPosition.setSelection(0);
if(order.mainPosition!=0){
for(int i=0;i<posList.size();i++){
if(posList.get(i).equals("Z"+mainPosition)){
viewBinding.spinnerPosition.setSelection(i);
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
mainPosition = Integer.parseInt(viewBinding.spinnerPosition.getSelectedItem().toString().substring(1));

if(order.deviceNum == deviceNum){
if(order.deviceNum ==1){
ConfigName.goodsProcess1.clear();
}else if(order.deviceNum ==2){
ConfigName.goodsProcess2.clear();
}else if(order.deviceNum ==3){
ConfigName.goodsProcess3.clear();
}else if(order.deviceNum ==4){
ConfigName.goodsProcess4.clear();
}
});
viewBinding.tvWok1.setSelected(false);
viewBinding.wokImage1.setVisibility(View.GONE);
viewBinding.tvWok2.setSelected(false);
viewBinding.wokImage2.setVisibility(View.GONE);
viewBinding.tvWok3.setSelected(false);
viewBinding.wokImage3.setVisibility(View.GONE);
viewBinding.tvWok4.setSelected(false);
viewBinding.wokImage4.setVisibility(View.GONE);
order.deviceNum = 0;
viewBinding.tvTip.setVisibility(order.deviceNum == 0?View.VISIBLE:View.GONE);
OrderDetailUtil.update(order);
return;
}

for(BPA_ORDER_DETAIL bean : OrderDetailUtil.getAll()){
if(bean.deviceNum == deviceNum){
NewToastUtil.getInstance().showToastError(bean.deviceNum+"号炒锅已绑定菜品【"+bean.goodsName+"】");
return;
}
}
viewBinding.tvWok1.setSelected(deviceNum==1);
viewBinding.wokImage1.setVisibility(deviceNum==1?View.VISIBLE:View.GONE);
viewBinding.tvWok2.setSelected(deviceNum==2);
viewBinding.wokImage2.setVisibility(deviceNum==2?View.VISIBLE:View.GONE);
viewBinding.tvWok3.setSelected(deviceNum==3);
viewBinding.wokImage3.setVisibility(deviceNum==3?View.VISIBLE:View.GONE);
viewBinding.tvWok4.setSelected(deviceNum==4);
viewBinding.wokImage4.setVisibility(deviceNum==4?View.VISIBLE:View.GONE);
order.deviceNum = deviceNum;
OrderDetailUtil.update(order);

ArrayList<BPA_GOODS_PROCESS_DETAIL> goodsrecipes = GoodsProcessDetailDBUtil.getByGroupId(order.groupId);
if(order.deviceNum ==1){
ConfigName.goodsProcess1.clear();
ConfigName.goodsProcess1.addAll(goodsrecipes);
}else if(order.deviceNum ==2){
ConfigName.goodsProcess2.clear();
ConfigName.goodsProcess2.addAll(goodsrecipes);
}else if(order.deviceNum ==3){
ConfigName.goodsProcess3.clear();
ConfigName.goodsProcess3.addAll(goodsrecipes);
}else if(order.deviceNum ==4){
ConfigName.goodsProcess4.clear();
ConfigName.goodsProcess4.addAll(goodsrecipes);
}
viewBinding.tvTip.setVisibility(order.deviceNum == 0?View.VISIBLE:View.GONE);
updateView();
}

private void updateView(){
List<String> posList = new ArrayList<>();
if(order.deviceNum == 2 || order.deviceNum == 3){
posList.add("Z4");
posList.add("Z5");
posList.add("Z6");
}else {
posList.add("Z1");
posList.add("Z2");
posList.add("Z3");
}

ArrayAdapter<String> spinnerAdapter3 = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, posList);
spinnerAdapter3.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinnerPosition.setAdapter(spinnerAdapter3);
viewBinding.spinnerPosition.setSelection(0);
if(order.mainPosition!=0){
for(int i=0;i<posList.size();i++){
if(posList.get(i).equals("Z"+mainPosition)){
viewBinding.spinnerPosition.setSelection(i);
}
}
}
mainPosition = Integer.parseInt(viewBinding.spinnerPosition.getSelectedItem().toString().substring(1));

viewBinding.llContent2.removeAllViews();
for (BPA_GOODS_PROCESS_DETAIL bean : materialData){
FoodPosSetView view = new FoodPosSetView(viewBinding.llContent2.getContext(), null,bean);
FoodPosSetView view = new FoodPosSetView(viewBinding.llContent2.getContext(), null,bean,order.deviceNum);
viewBinding.llContent2.addView(view);
}
}
@@ -190,12 +306,10 @@ public class FoodPosSetDialog extends DialogFragment {
@Override
public void dismiss() {
mainPosition = Integer.parseInt(viewBinding.spinnerPosition.getSelectedItem().toString().substring(1));
deviceNum = Integer.parseInt(viewBinding.spinnerWok.getSelectedItem().toString().substring(0,1));
order.mainPosition = mainPosition;
order.deviceNum = deviceNum;
OrderDetailUtil.update(order);
if(listener!=null){
listener.clickListener(null,null);
listener.clickListener(null,order.deviceNum);
}
super.dismiss();
}


+ 215
- 47
app/src/main/java/com/bonait/bnframework/newui/fragment/main/HomeOrderFragment.java View File

@@ -16,6 +16,7 @@ import androidx.lifecycle.LifecycleObserver;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
@@ -26,6 +27,7 @@ import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogOrderBinding;
import com.bonait.bnframework.databinding.DialogTipBinding;
import com.bonait.bnframework.databinding.DialogWokMakeTipBinding;
import com.bonait.bnframework.databinding.FragmentHomeOrderBinding;
import com.bonait.bnframework.event.FreshOrderEvent;
@@ -43,6 +45,7 @@ import com.bonait.bnframework.newui.dialog.check.FoodInfoDialog;
import com.bonait.bnframework.newui.dialog.control.FoodPosSetDialog;
import com.bonait.bnframework.newui.widget.DeviceStatusView;
import com.bonait.bnframework.newui.widget.NewToastUtil;
import com.mobsandgeeks.saripaar.annotation.Or;
import com.orhanobut.logger.Logger;

import org.greenrobot.eventbus.EventBus;
@@ -176,6 +179,10 @@ public class HomeOrderFragment extends BaseFragment{
jumpToCook(mData.get(position));
return;
}
if(mData.get(position).deviceNum==0){
NewToastUtil.getInstance().showToast("请先绑定设备位置!");
return;
}
if(mData.get(position).status==0){
AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_wok_make_tip, (layoutView, xCom) -> {
DialogWokMakeTipBinding binding = DialogWokMakeTipBinding.bind(layoutView);
@@ -203,25 +210,78 @@ public class HomeOrderFragment extends BaseFragment{
viewBinding.recyclerInfo.setAdapter(orderAdapter1);

viewBinding.btnLocationInfo.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
return;
lookPosition(false);
});
viewBinding.btnFoodPosSet.setOnClickListener(v->{
setPositionInfo();
});
changeRightBtn();
}

/**
* 查看位置信息
*/
private void lookPosition(boolean showBack){
if(ConfigName.getInstance().isFastClick()){
return;
}
if(foodInfoList.isEmpty()){
return;
}
FoodInfoDialog foodInfoDialog = new FoodInfoDialog();
Bundle bundle = new Bundle();
bundle.putString("orderId",orderDetail.id);
bundle.putBoolean("showBack",showBack);
foodInfoDialog.setArguments(bundle);
foodInfoDialog.setListener(new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
orderDetails1.clear();
orderDetails1.addAll(OrderDetailUtil.getAll());
orderAdapter1.notifyDataSetChanged();
if(orderAdapter1.getCurrentPosition()>=0){
orderClick(orderAdapter1.getData().get(orderAdapter1.getCurrentPosition()));
}
}
if(foodInfoList.isEmpty()){
return;

@Override
public void clickListenerNew(View v, int k, Object data) {
setPositionInfo();
}
FoodInfoDialog foodInfoDialog = new FoodInfoDialog();
Bundle bundle = new Bundle();
bundle.putString("orderId",orderDetail.id);
foodInfoDialog.setArguments(bundle);
foodInfoDialog.setListener(new MyClickListener() {
});
if(getActivity()!=null){
foodInfoDialog.show(getActivity().getSupportFragmentManager(),"配料信息");
}
}

/**
* 设置位置信息
*/
private void setPositionInfo(){
if(ConfigName.getInstance().isFastClick()){
return;
}
if(foodInfoList.isEmpty()){
return;
}
FoodPosSetDialog dialog = new FoodPosSetDialog();
Bundle bundle = new Bundle();
bundle.putString("orderId",orderDetail.id);
dialog.setArguments(bundle);
if(getActivity()!=null){
dialog.show(getActivity().getSupportFragmentManager(),"设置配料位置");
dialog.setListener(new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
public void clickListener(View v, Object deviceNum) {
orderDetails1.clear();
orderDetails1.addAll(OrderDetailUtil.getAll());
orderAdapter1.notifyDataSetChanged();
if(orderAdapter1.getCurrentPosition()>=0){
orderClick(orderAdapter1.getData().get(orderAdapter1.getCurrentPosition()));
}
if((int)deviceNum != 0){
lookPosition(true);
}
}

@Override
@@ -229,42 +289,7 @@ public class HomeOrderFragment extends BaseFragment{

}
});
if(getActivity()!=null){
foodInfoDialog.show(getActivity().getSupportFragmentManager(),"配料信息");
}
});
viewBinding.btnFoodPosSet.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
return;
}
if(foodInfoList.isEmpty()){
return;
}
FoodPosSetDialog dialog = new FoodPosSetDialog();
Bundle bundle = new Bundle();
bundle.putString("orderId",orderDetail.id);
dialog.setArguments(bundle);
if(getActivity()!=null){
dialog.show(getActivity().getSupportFragmentManager(),"修改配料位置");
dialog.setListener(new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
orderDetails1.clear();
orderDetails1.addAll(OrderDetailUtil.getAll());
orderAdapter1.notifyDataSetChanged();
if(orderAdapter1.getCurrentPosition()>=0){
orderClick(orderAdapter1.getData().get(orderAdapter1.getCurrentPosition()));
}
}

@Override
public void clickListenerNew(View v, int k, Object data) {

}
});
}
});
changeRightBtn();
}
}

/**
@@ -278,7 +303,7 @@ public class HomeOrderFragment extends BaseFragment{
}else {
if(orderDetail.status!=0){
viewBinding.btnFoodPosSet.setVisibility(View.GONE);
viewBinding.btnLocationInfo.setVisibility(View.GONE);
viewBinding.btnLocationInfo.setVisibility(View.VISIBLE);
}else {
viewBinding.btnFoodPosSet.setVisibility(View.VISIBLE);
viewBinding.btnLocationInfo.setVisibility(View.VISIBLE);
@@ -520,6 +545,15 @@ public class HomeOrderFragment extends BaseFragment{
if (ConfigName.getInstance().isFastClick()){
return;
}
if(orderDetails1.get(position).deviceNum ==1){
ConfigName.goodsProcess1.clear();
}else if(orderDetails1.get(position).deviceNum ==2){
ConfigName.goodsProcess2.clear();
}else if(orderDetails1.get(position).deviceNum ==3){
ConfigName.goodsProcess3.clear();
}else if(orderDetails1.get(position).deviceNum ==4){
ConfigName.goodsProcess4.clear();
}
BPA_ORDER_DETAIL orderDetail1 = OrderDetailUtil.getById(orderDetails1.get(position).id);
OrderDetailUtil.deleteById(orderDetails1.get(position).id);
orderDetails1.remove(position);
@@ -591,6 +625,9 @@ public class HomeOrderFragment extends BaseFragment{
}
switch (status){
case 0:
if(checkPositionResue()){
return;
}
orderDetails1.get(position).status = 1;
BPA_ORDER_DETAIL bean = orderDetails1.get(position);
bean.createTime = "0";
@@ -613,6 +650,15 @@ public class HomeOrderFragment extends BaseFragment{
foodInfoAdapter.notifyDataSetChanged();
changeRightBtn();
}
if(orderDetails1.get(position).deviceNum ==1){
ConfigName.goodsProcess1.clear();
}else if(orderDetails1.get(position).deviceNum ==2){
ConfigName.goodsProcess2.clear();
}else if(orderDetails1.get(position).deviceNum ==3){
ConfigName.goodsProcess3.clear();
}else if(orderDetails1.get(position).deviceNum ==4){
ConfigName.goodsProcess4.clear();
}
OrderDetailUtil.deleteById(orderDetails1.get(position).id);
orderDetails1.remove(position);
orderAdapter1.setCurrentPosition(-1);
@@ -630,6 +676,9 @@ public class HomeOrderFragment extends BaseFragment{
}
xCom.dismissX();
if(status==0){
if(checkPositionResue()){
return;
}
orderDetails1.get(position).status = 1;
BPA_ORDER_DETAIL bean = orderDetails1.get(position);
bean.createTime = "0";
@@ -680,6 +729,125 @@ public class HomeOrderFragment extends BaseFragment{
}
}

/**
* 检查位置是否重复使用
*/
private boolean checkPositionResue(){
try {
List<BPA_GOODS_PROCESS_DETAIL> goodsrecipes = new ArrayList<>();
List<BPA_GOODS_PROCESS_DETAIL> otherCooking = new ArrayList<>();
StringBuffer desc = new StringBuffer();
if(!OrderDetailUtil.getByFilterMaking(orderDetail.deviceNum,orderDetail.mainPosition).isEmpty()){
desc.append("主料Z").append(orderDetail.mainPosition).append("|");
}else {
if(orderDetail.deviceNum ==1){
goodsrecipes = ConfigName.goodsProcess1;
if(ConfigName.IsStart[1]){
otherCooking.addAll(ConfigName.goodsProcess2);
}
if(ConfigName.IsStart[2]){
otherCooking.addAll(ConfigName.goodsProcess3);
}
if(ConfigName.IsStart[3]){
otherCooking.addAll(ConfigName.goodsProcess4);
}
}else if(orderDetail.deviceNum ==2){
goodsrecipes = ConfigName.goodsProcess2;
if(ConfigName.IsStart[0]){
otherCooking.addAll(ConfigName.goodsProcess1);
}
if(ConfigName.IsStart[2]){
otherCooking.addAll(ConfigName.goodsProcess3);
}
if(ConfigName.IsStart[3]){
otherCooking.addAll(ConfigName.goodsProcess4);
}
}else if(orderDetail.deviceNum ==3){
goodsrecipes = ConfigName.goodsProcess3;
if(ConfigName.IsStart[1]){
otherCooking.addAll(ConfigName.goodsProcess2);
}
if(ConfigName.IsStart[0]){
otherCooking.addAll(ConfigName.goodsProcess1);
}
if(ConfigName.IsStart[3]){
otherCooking.addAll(ConfigName.goodsProcess4);
}
}else if(orderDetail.deviceNum ==4){
goodsrecipes = ConfigName.goodsProcess4;
if(ConfigName.IsStart[1]){
otherCooking.addAll(ConfigName.goodsProcess2);
}
if(ConfigName.IsStart[2]){
otherCooking.addAll(ConfigName.goodsProcess3);
}
if(ConfigName.IsStart[0]){
otherCooking.addAll(ConfigName.goodsProcess1);
}
}
if(goodsrecipes.isEmpty()){
NewToastUtil.getInstance().showToast("商品工序为空!");
return true;
}

for(BPA_GOODS_PROCESS_DETAIL detail : goodsrecipes){
if(detail.processname.equals("辅料")){
for(BPA_GOODS_PROCESS_DETAIL detailing : otherCooking){
if(detail.processname.equals(detailing.processname)){
String[] position1 = detail.processvalue.split("\\|");
String[] position2 = detailing.processvalue.split("\\|");
if(position1[1].equals(position2[1])){
desc.append(position2[1]).append("|");
break;
}
}
}
}
}
}
if(desc.length()>0){
desc.substring(0,desc.length()-1);
desc.append("\n库位正在被其他设备使用,请更换位置重试");
}else {
List<String> posList = new ArrayList<>();
for(BPA_GOODS_PROCESS_DETAIL detail : goodsrecipes){
if(detail.processname.equals("辅料")||detail.processname.equals("主料")){
String[] position1 = detail.processvalue.split("\\|");
if(posList.contains(position1[1])){
desc.append(position1[1]).append("|");
}else {
posList.add(position1[1]);
}
}
}
if(desc.length()>0){
desc.substring(0,desc.length()-1);
desc.append("\n库位被重复使用,请更换位置重试");
}
}
if(desc.length()>0){
AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_tip, (layoutView, xCom) -> {
DialogTipBinding binding = DialogTipBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
binding.title.setText("警告");
binding.message.setText(desc.toString());
binding.close.setOnClickListener(view1->{
xCom.dismissX();
});
binding.submit.setOnClickListener(view1 -> {
xCom.dismissX();
});
});
return true;
}
return false;
}catch (Exception e){
NewToastUtil.getInstance().showToastError("startMakingThread 下单异常:"+e.getMessage());
RecordManager.getInstance().addLogRecord("角色操作日志","startMakingThread 下单异常:"+e.getMessage());
return true;
}
}

/**
* 跳转去烹饪页面
*/


+ 39
- 2
app/src/main/java/com/bonait/bnframework/newui/widget/FoodPosSetView.java View File

@@ -7,6 +7,7 @@ import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
@@ -24,17 +25,20 @@ import java.util.List;
* @description:
* @date: 2024/5/16 17:53.
*/
public class FoodPosSetView extends FrameLayout {
public class FoodPosSetView extends LinearLayout {

private ViewFoodPosSetBinding viewBinding;
private BPA_GOODS_PROCESS_DETAIL detail;
private int deviceNum = 0;

public FoodPosSetView(Context context, AttributeSet attrs, BPA_GOODS_PROCESS_DETAIL detail) {

public FoodPosSetView(Context context, AttributeSet attrs, BPA_GOODS_PROCESS_DETAIL detail,int deviceNum) {
super(context, attrs);
View root= LayoutInflater.from(context).inflate(R.layout.view_food_pos_set, this);
viewBinding = ViewFoodPosSetBinding.bind(root);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
this.detail = detail;
this.deviceNum = deviceNum;
init();
}

@@ -72,6 +76,7 @@ public class FoodPosSetView extends FrameLayout {
detail.processvalue = detail.processvalue.replace(posInfo,"辅料位置,"+viewBinding.spinner.getSelectedItem().toString());
detail.processms = detail.processms.replace(res2[1],viewBinding.spinner.getSelectedItem().toString());
GoodsProcessDetailDBUtil.update(detail);
updateData(detail);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
@@ -83,4 +88,36 @@ public class FoodPosSetView extends FrameLayout {
}
}
}

private void updateData(BPA_GOODS_PROCESS_DETAIL detail){
if(deviceNum ==1){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess1){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}else if(deviceNum ==2){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess2){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}else if(deviceNum ==3){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess3){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}else if(deviceNum ==4){
for(BPA_GOODS_PROCESS_DETAIL bean:ConfigName.goodsProcess4){
if(detail.id.equals(bean.id)){
bean.processvalue = detail.processvalue;
bean.processms = detail.processms;
}
}
}
}
}

+ 5
- 0
app/src/main/res/drawable/bg_round25_gray.xml View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_25"/>
<solid android:color="@color/main_background"/>
</shape>

+ 22
- 0
app/src/main/res/drawable/bg_wok_select.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_selected="true">
<shape>
<solid android:color="#c6d7ed" />
<corners android:radius="25dp" />
<stroke
android:width="1dp"
android:color="#c6d7ed" />
</shape>
</item>
<item>
<shape>
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/color3" />
<corners android:radius="25dp"/>
</shape>
</item>
</selector>

+ 6
- 0
app/src/main/res/drawable/color_text_wok_select.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_selected="true" android:color="@color/green_select"/>
<item android:color="@color/black"/>
</selector>

+ 28
- 0
app/src/main/res/layout/new/layout/dialog_food_info.xml View File

@@ -281,6 +281,34 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>

<TextView
android:id="@+id/btn_back"
android:layout_width="200dp"
android:layout_height="@dimen/dp_80"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:text="返回"
android:textSize="32sp"
android:visibility="gone"
tools:visibility="visible"
android:textColor="@color/white"
/>

<TextView
android:id="@+id/tv_tip"
android:layout_width="match_parent"
android:layout_below="@id/btn_close1"
android:background="#10000000"
android:orientation="horizontal"
android:layout_marginStart="0dp"
android:visibility="gone"
tools:visibility="visible"
android:textStyle="bold"
android:textSize="42sp"
android:textColor="@color/white"
android:gravity="center"
android:layout_height="match_parent"/>
</RelativeLayout>

</LinearLayout>

+ 216
- 69
app/src/main/res/layout/new/layout/dialog_food_pos_set.xml View File

@@ -9,9 +9,9 @@
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="1700dp"
android:background="@drawable/bg_round25_white"
android:layout_height="wrap_content">
android:layout_width="1800dp"
android:background="@drawable/bg_round25_gray"
android:layout_height="950dp">

<TextView
android:id="@+id/title1"
@@ -38,118 +38,265 @@
android:text="确定"
/>
<LinearLayout
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginStart="700dp"
android:layout_marginStart="650dp"
android:layout_marginTop="110dp"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv1"
android:layout_width="450dp"
android:layout_width="300dp"
android:orientation="vertical"
android:layout_marginTop="90dp"
android:layout_marginBottom="50dp"
android:textColor="@color/black"
android:textSize="32sp"
android:textStyle="bold"
android:text="主料位置"
android:gravity="end"
android:paddingEnd="50dp"
android:text="炒锅位置"
android:gravity="center"
android:layout_height="wrap_content"/>


<TextView
android:id="@+id/tv2"
android:layout_width="450dp"
android:layout_width="780dp"
android:layout_marginStart="20dp"
android:orientation="vertical"
android:layout_marginTop="90dp"
android:layout_marginBottom="50dp"
android:layout_marginEnd="100dp"
android:layout_alignParentEnd="true"
android:textColor="@color/black"
android:textSize="32sp"
android:textStyle="bold"
android:text="料位置"
android:gravity="end"
android:paddingEnd="50dp"
android:layout_height="wrap_content">
android:text="主料位置"
android:gravity="center"
android:layout_height="wrap_content"/>

</TextView>
</LinearLayout>
<include
android:id="@+id/layout_huojia"
android:layout_width="700dp"
android:layout_height="350dp"
layout="@layout/layout_huojia"
android:layout_marginTop="90dp"
/>

<LinearLayout
<FrameLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginStart="700dp"
android:layout_height="wrap_content">
android:layout_below="@id/ll_title"
android:layout_alignStart="@id/ll_title"
android:layout_marginBottom="20dp"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="450dp"
android:id="@+id/ll_wok"
android:layout_width="300dp"
android:orientation="vertical"
android:layout_marginTop="140dp"
android:layout_marginBottom="50dp"
android:layout_height="wrap_content">
<Spinner
android:id="@+id/spinner_position"
style="@style/commonSpinnerStyle"
android:layout_height="@dimen/dp_70"
android:layout_width="300dp"
android:layout_marginTop="20dp"
android:layout_gravity="end"
/>
android:layout_marginBottom="20dp"
android:layout_height="match_parent">

<TextView
android:id="@+id/tv3"
android:layout_width="450dp"
android:orientation="vertical"
android:layout_marginTop="50dp"
android:textColor="@color/black"
android:textSize="32sp"
android:textStyle="bold"
android:text="炒锅位置"
android:gravity="end"
android:paddingEnd="50dp"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@+id/fl_wok1"
android:layout_width="match_parent"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:layout_height="140dp">
<TextView
android:id="@+id/tv_wok1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="1号炒锅"
android:textSize="32sp"
android:textStyle="bold"
android:background="@drawable/bg_wok_select"
android:textColor="@drawable/color_text_wok_select"
tools:textColor="@color/green_select"
tools:background="#c6d7ed"
/>
<ImageView
android:id="@+id/wok_image1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="30dp"
android:layout_gravity="center_vertical|end"
android:src="@drawable/ic_true"
android:visibility="gone"
tools:visibility="visible"
android:layout_marginBottom="5dp"
/>
</FrameLayout>
<FrameLayout
android:id="@+id/fl_wok2"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="140dp">
<TextView
android:id="@+id/tv_wok2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="2号炒锅"
android:textSize="32sp"
android:textStyle="bold"
android:background="@drawable/bg_wok_select"
android:textColor="@drawable/color_text_wok_select"
/>
<ImageView
android:id="@+id/wok_image2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="30dp"
android:layout_gravity="center_vertical|end"
android:src="@drawable/ic_true"
android:layout_marginBottom="5dp"
android:visibility="gone"
/>
</FrameLayout>
<FrameLayout
android:id="@+id/fl_wok3"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="140dp">
<TextView
android:id="@+id/tv_wok3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="3号炒锅"
android:textSize="32sp"
android:textStyle="bold"
android:background="@drawable/bg_wok_select"
android:textColor="@drawable/color_text_wok_select"
/>
<ImageView
android:id="@+id/wok_image3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="30dp"
android:layout_gravity="center_vertical|end"
android:src="@drawable/ic_true"
android:layout_marginBottom="5dp"
android:visibility="gone"
/>
</FrameLayout>
<FrameLayout
android:id="@+id/fl_wok4"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="140dp">
<TextView
android:id="@+id/tv_wok4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="4号炒锅"
android:textSize="32sp"
android:textStyle="bold"
android:background="@drawable/bg_wok_select"
android:textColor="@drawable/color_text_wok_select"
/>
<ImageView
android:id="@+id/wok_image4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="30dp"
android:layout_gravity="center_vertical|end"
android:src="@drawable/ic_true"
android:layout_marginBottom="5dp"
android:visibility="gone"
/>
</FrameLayout>
</LinearLayout>

<LinearLayout
android:layout_width="780dp"
android:layout_marginTop="20dp"
android:layout_marginStart="320dp"
android:background="@drawable/bg_round25_white"
android:gravity="center"
android:layout_height="90dp">
<Spinner
android:id="@+id/spinner_wok"
android:id="@+id/spinner_position"
style="@style/commonSpinnerStyle"
android:layout_height="@dimen/dp_70"
android:layout_width="300dp"
android:layout_marginTop="20dp"
android:layout_gravity="end"
/>
</LinearLayout>

<LinearLayout
android:id="@+id/ll_content2"
android:layout_width="450dp"

<TextView
android:id="@+id/tv3"
android:layout_width="780dp"
android:orientation="vertical"
android:layout_marginTop="140dp"
android:layout_marginBottom="50dp"
android:layout_marginEnd="100dp"
android:layout_alignParentEnd="true"
tools:layout_height="230dp"
android:layout_height="wrap_content">
android:textColor="@color/black"
android:textSize="32sp"
android:textStyle="bold"
android:text="辅料位置"
android:layout_marginStart="320dp"
android:layout_marginTop="130dp"
android:gravity="center"
android:layout_height="wrap_content"/>

</LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="780dp"
android:layout_marginStart="320dp"
android:layout_height="match_parent"
android:layout_marginTop="200dp"
android:layout_marginBottom="20dp"
android:background="@drawable/bg_round25_white"
>
<LinearLayout
android:id="@+id/ll_content2"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_alignParentEnd="true"
android:layout_height="wrap_content">

</LinearLayout>
</ScrollView>

<TextView
android:id="@+id/tv_tip"
android:layout_width="780dp"
android:background="#30000000"
android:orientation="horizontal"
android:layout_marginStart="320dp"
android:layout_marginBottom="20dp"
android:visibility="gone"
android:textStyle="bold"
android:textSize="42sp"
android:textColor="@color/white"
android:text="←请先选择左侧炒锅位置"
android:gravity="center"
android:layout_height="match_parent"/>
</FrameLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注意:辅料的位置不能重复\nZ1 Z2 Z3库位只能绑定1号和4号炒锅\nZ4 Z5 Z6库位只能绑定2号和3号炒锅"
android:textSize="28sp"
android:layout_marginTop="420dp"
android:layout_marginTop="540dp"
android:textColor="@color/yellow_primary_dark"
android:layout_marginStart="150dp"
android:paddingBottom="10dp"
/>
<include
android:id="@+id/layout_huojia"
android:layout_width="700dp"
android:layout_height="350dp"
layout="@layout/layout_huojia"
android:layout_marginTop="190dp"
/>

</RelativeLayout>

</LinearLayout>

+ 2
- 2
app/src/main/res/layout/new/layout/dialog_root_tip.xml View File

@@ -23,8 +23,8 @@
/>
<include
android:id="@+id/content2"
android:layout_width="1850dp"
android:layout_height="950dp"
android:layout_width="1000dp"
android:layout_height="900dp"
layout="@layout/layout_root_tip2"
android:visibility="gone"
/>


+ 12
- 9
app/src/main/res/layout/new/layout/view_food_pos_set.xml View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="450dp"
android:layout_width="780dp"
android:layout_height="@dimen/dp_130"
android:paddingBottom="20dp"
android:id="@+id/root"
@@ -12,23 +12,26 @@
<TextView
android:id="@+id/name"
android:paddingEnd="5dp"
android:layout_width="@dimen/dp_280"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginEnd="10dp"
android:layout_height="match_parent"
tools:text="液体料液体料液体料"
android:textSize="@dimen/sp_36"
android:maxLines="1"
android:singleLine="true"
tools:text="液体料液体料液\n体料"
android:textSize="@dimen/sp_32"
android:maxLines="2"
android:gravity="center_vertical|end"
android:ellipsize="end"
android:textColor="@color/black"
android:layout_marginStart="20dp"
/>
<Spinner
android:id="@+id/spinner"
style="@style/commonSpinnerStyle"
android:layout_width="@dimen/dp_170"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:paddingStart="10dp"
android:layout_marginEnd="20dp"
/>

</FrameLayout>
</LinearLayout>

+ 9
- 0
app/src/main/res/layout/svg/drawable/ic_true.xml View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M843.7,293.6 L425.3,712.1 186.1,472.9 66.6,592.5 425.3,951.2 963.3,413.2Z"
android:fillColor="#68a10f"/>
</vector>

+ 3
- 0
app/src/main/res/values/colors.xml View File

@@ -144,4 +144,7 @@
<color name="right_bg_blue_50p">#800088FF</color>
<color name="right_bg_green_50p">#80567722</color>
<color name="right_bg_red_50p">#80DA5A17</color>

<color name="green_select">#68A00F</color>

</resources>

+ 1
- 1
app/src/main/res/values/strings.xml View File

@@ -1,5 +1,5 @@
<resources>
<string name="app_name">一拖炒菜机器人</string>
<string name="app_name">一拖炒菜机器人</string>
<string name="file_normal">常用文件</string>
<string name="file_all">全部文件</string>
<string name="empty_data">没有数据</string>


+ 1
- 1
build.gradle View File

@@ -52,7 +52,7 @@ ext { // 统一版本入口
// 炒锅
// 设置applicationId(这里很重要,两个相同applicationId的apk不同同时安装在同一台Android手机中)
// applicationId="com.bonait.shanghaiminzhong"
applicationId="com.bonait.wokrobot"
applicationId="com.bonait.wokrobot14"
// 奶茶机
// 设置applicationId(这里很重要,两个相同applicationId的apk不同同时安装在同一台Android手机中)
// applicationId= "com.bonait.ncj"


Loading…
Cancel
Save