From fb86909acdb4ccccfe0812b64519ccea238fc778 Mon Sep 17 00:00:00 2001 From: liup <1454939542@qq.com> Date: Thu, 22 Aug 2024 13:56:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/ConfigName.java | 2 +- .../common/utils/UpdateAppUtils.java | 4 +- .../newui/activity/MainHActivity.java | 2 + .../dialog/control/RobotControlDialog.java | 16 ++++- .../fragment/setting/SceneSetFragment.java | 49 ++++++++++++++ .../main/res/layout/fragment_scene_set.xml | 67 +++++++++++++++++-- build.gradle | 8 +-- 7 files changed, 134 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java index b1cdf1ba..b844dcc5 100644 --- a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java +++ b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java @@ -78,7 +78,7 @@ public class ConfigName { * 锅口朝向 */ public String guokouChaoxiang = ""; - public static String dataPath = "/hblxiaochaokaoxiangdb"; + public static String dataPath = "/hbldbWokRobot"; public String oven_wendu="0"; diff --git a/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java b/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java index cec5c798..fadf0838 100644 --- a/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java +++ b/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java @@ -67,9 +67,9 @@ public class UpdateAppUtils { private static void doPost(final Context context,boolean showToast) { VersionMode mode=new VersionMode(); mode.productCode="1769564215952125952"; - mode.moduleCode="shmz"; + mode.moduleCode="hhzx"; mode.serverCode="1769564338190921728";//服务器 - mode.branchCode="1810555594505506817"; + mode.branchCode="1811244806858919937"; String msg= new Json().objectToJson(VersionMode.class, mode); String getNewVersionUrl =ConfigName.getInstance().UpdateVersion; diff --git a/app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java b/app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java index 3d16a089..10b3e22e 100644 --- a/app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java +++ b/app/src/main/java/com/bonait/bnframework/newui/activity/MainHActivity.java @@ -28,6 +28,7 @@ import com.bonait.bnframework.common.db.file.DBHelper; import com.bonait.bnframework.common.db.mode.BPA_ALERTLOG; import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD; import com.bonait.bnframework.common.db.mode.BPA_ORDER_DETAIL; +import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST; import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD; import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD; import com.bonait.bnframework.common.db.util.OrderDetailUtil; @@ -132,6 +133,7 @@ public class MainHActivity extends BaseActivity { DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_RECORD.class,null); DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SUBORDER_RECORD.class,null); DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ALERTLOG.class,null); + DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_LIST.class,null); PreferenceUtils.setInt("loginNum",0); }else { PreferenceUtils.setInt("loginNum",loginNum+1); diff --git a/app/src/main/java/com/bonait/bnframework/newui/dialog/control/RobotControlDialog.java b/app/src/main/java/com/bonait/bnframework/newui/dialog/control/RobotControlDialog.java index c1bd6ec0..2fa0c64e 100644 --- a/app/src/main/java/com/bonait/bnframework/newui/dialog/control/RobotControlDialog.java +++ b/app/src/main/java/com/bonait/bnframework/newui/dialog/control/RobotControlDialog.java @@ -268,7 +268,7 @@ public class RobotControlDialog extends DialogFragment { private HashMap data = new HashMap<>();; @SuppressLint("NonConstantResourceId") - @OnClick({R.id.top1, R.id.top2,R.id.top3,R.id.top4, + @OnClick({R.id.top1, R.id.top2,R.id.top3,R.id.top4,R.id.top5,R.id.top6, R.id.right1,R.id.right2,R.id.right3,R.id.right4,R.id.right5,R.id.right6, R.id.btn_wok_chucai,R.id.btn_wok_chucai2,R.id.btn_weihu,R.id.btn_weihu_finish}) public void onViewClicked(View view) { @@ -387,6 +387,20 @@ public class RobotControlDialog extends DialogFragment { data.put("烹饪(秒)","0"); robotPutFoo2(); break; + case R.id.top5: + data.put("辅料名称","测试投料"); + data.put("辅料位置","F5"); + data.put("炒制位置","炒菜位高"); + data.put("烹饪(秒)","0"); + robotPutFoo2(); + break; + case R.id.top6: + data.put("辅料名称","测试投料"); + data.put("辅料位置","F6"); + data.put("炒制位置","炒菜位高"); + data.put("烹饪(秒)","0"); + robotPutFoo2(); + break; case R.id.right1: data.put("主料名称","测试投料"); data.put("主料位置","Z1"); diff --git a/app/src/main/java/com/bonait/bnframework/newui/fragment/setting/SceneSetFragment.java b/app/src/main/java/com/bonait/bnframework/newui/fragment/setting/SceneSetFragment.java index 56c503a7..76c85000 100644 --- a/app/src/main/java/com/bonait/bnframework/newui/fragment/setting/SceneSetFragment.java +++ b/app/src/main/java/com/bonait/bnframework/newui/fragment/setting/SceneSetFragment.java @@ -11,13 +11,23 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.bonait.bnframework.HBL.Thread.ThreadManager; +import com.bonait.bnframework.MainApplication; import com.bonait.bnframework.R; import com.bonait.bnframework.common.base.BaseFragment; import com.bonait.bnframework.common.constant.ConfigName; import com.bonait.bnframework.common.db.QueryDB; +import com.bonait.bnframework.common.db.file.DBHelper; +import com.bonait.bnframework.common.db.mode.BPA_ALERTLOG; +import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD; +import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST; +import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD; +import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD; import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET; +import com.bonait.bnframework.common.utils.AlertDialogUtils; import com.bonait.bnframework.common.utils.DisplayManager; import com.bonait.bnframework.common.utils.PreferenceUtils; +import com.bonait.bnframework.databinding.DialogTipBinding; +import com.bonait.bnframework.databinding.DialogWokTipBinding; import com.bonait.bnframework.databinding.FragmentSceneSetBinding; import com.bonait.bnframework.newui.http.UpdateDataService; import com.bonait.bnframework.newui.widget.NewToastUtil; @@ -123,6 +133,45 @@ public class SceneSetFragment extends BaseFragment { set_main4.userID = ConfigName.getInstance().user.userID; QueryDB.AddSystemset(set_main1); }); + + viewBinding.btnClearLog.setOnClickListener(v->{ + AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_tip, (layoutView, xCom) -> { + DialogTipBinding binding = DialogTipBinding.bind(layoutView); + DisplayManager.scaleViewGroup(binding.getRoot()); + binding.title.setText("请确认"); + binding.message.setText("是否清除本地日志记录"); + binding.close.setOnClickListener(view1->{ + xCom.dismissX(); + }); + binding.submit.setOnClickListener(view1 -> { + xCom.dismissX(); + DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_LOG_RECORD.class,null); + DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ALERTLOG.class,null); + PreferenceUtils.setInt("loginNum",0); + NewToastUtil.getInstance().showToast("清除成功"); + }); + }); + + }); + viewBinding.btnClearOrder.setOnClickListener(v->{ + AlertDialogUtils.showCancelAndConfirmDialog(getActivity(), R.layout.dialog_tip, (layoutView, xCom) -> { + DialogTipBinding binding = DialogTipBinding.bind(layoutView); + DisplayManager.scaleViewGroup(binding.getRoot()); + binding.title.setText("请确认"); + binding.message.setText("是否清除本地订单记录"); + binding.close.setOnClickListener(view1->{ + xCom.dismissX(); + }); + binding.submit.setOnClickListener(view1 -> { + xCom.dismissX(); + DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_RECORD.class,null); + DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SUBORDER_RECORD.class,null); + DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_LIST.class,null); + PreferenceUtils.setInt("loginNum",0); + NewToastUtil.getInstance().showToast("清除成功"); + }); + }); + }); } private void initData(){ diff --git a/app/src/main/res/layout/fragment_scene_set.xml b/app/src/main/res/layout/fragment_scene_set.xml index b5e80827..2828f612 100644 --- a/app/src/main/res/layout/fragment_scene_set.xml +++ b/app/src/main/res/layout/fragment_scene_set.xml @@ -11,12 +11,12 @@ android:layout_width="match_parent" android:orientation="vertical" android:padding="40dp" - android:layout_marginTop="40dp" + android:layout_marginTop="20dp" android:layout_height="match_parent"> + + + +