Browse Source

添加日志记录,订单记录;优化功能

桌面小炒机
liup 7 months ago
parent
commit
bcb7e675e3
76 changed files with 2646 additions and 217 deletions
  1. +2
    -2
      .idea/deploymentTargetSelector.xml
  2. +3
    -1
      app/build.gradle
  3. +10
    -0
      app/src/main/AndroidManifest.xml
  4. +10
    -0
      app/src/main/java/com/bonait/bnframework/Model/OrderRecordBean.java
  5. +28
    -1
      app/src/main/java/com/bonait/bnframework/Model/ProcessValueUtil.java
  6. +13
    -5
      app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/LoginActivity.java
  7. +4
    -0
      app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/WelcomeActivity.java
  8. +17
    -1
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  9. +147
    -0
      app/src/main/java/com/bonait/bnframework/business/RecordManager.java
  10. +7
    -0
      app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java
  11. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  12. +35
    -0
      app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java
  13. +4
    -0
      app/src/main/java/com/bonait/bnframework/common/db/file/DBHelper.java
  14. +2
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_LOG.java
  15. +26
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_LOG_RECORD.java
  16. +29
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_ORDER_RECORD.java
  17. +33
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_SUBORDER_RECORD.java
  18. +15
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/GoodsProcessDetailDBUtil.java
  19. +69
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/LogRecordUtil.java
  20. +77
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/OrderRecordUtil.java
  21. +20
    -1
      app/src/main/java/com/bonait/bnframework/common/db/util/SubAttributeGroupDBUtil.java
  22. +77
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/SubOrderRecordUtil.java
  23. +2
    -0
      app/src/main/java/com/bonait/bnframework/common/image/MyBitmapUtils.java
  24. +2
    -1
      app/src/main/java/com/bonait/bnframework/common/image/utils/LocalCacheUtils.java
  25. +30
    -5
      app/src/main/java/com/bonait/bnframework/ui/activity/CookingActivity.java
  26. +13
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java
  27. +68
    -40
      app/src/main/java/com/bonait/bnframework/ui/activity/EditClassifyActivity.java
  28. +4
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/EditGoodsActivity.java
  29. +7
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/ErrorInfoActivity.java
  30. +202
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/LogRecordActivity.java
  31. +17
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/MainActivity.java
  32. +201
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/OrderRecordActivity.java
  33. +18
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/RecProcessActivity.java
  34. +5
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/SetSeasoningActivity.java
  35. +5
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/SystemSetActivity.java
  36. +59
    -0
      app/src/main/java/com/bonait/bnframework/ui/adapter/LocalLogAdapter.java
  37. +55
    -0
      app/src/main/java/com/bonait/bnframework/ui/adapter/OrderAdapter.java
  38. +59
    -0
      app/src/main/java/com/bonait/bnframework/ui/adapter/SubOrderAdapter.java
  39. +1
    -2
      app/src/main/java/com/bonait/bnframework/ui/adapter/goods/CloudGoodsAdapter.java
  40. +4
    -2
      app/src/main/java/com/bonait/bnframework/ui/adapter/goods/LocalGoodsAdapter.java
  41. +16
    -0
      app/src/main/java/com/bonait/bnframework/ui/dialog/DeviceControlDialog.java
  42. +67
    -23
      app/src/main/java/com/bonait/bnframework/ui/dialog/EditGoodsDialog.java
  43. +97
    -0
      app/src/main/java/com/bonait/bnframework/ui/dialog/SubOrderDialog.java
  44. +5
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/HomeDevicesFragment.java
  45. +10
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/HomeMainFragment.java
  46. +5
    -3
      app/src/main/java/com/bonait/bnframework/ui/fragment/goods/CloudGoodsFragment.java
  47. +8
    -4
      app/src/main/java/com/bonait/bnframework/ui/fragment/goods/LocalGoodsFragment.java
  48. +82
    -7
      app/src/main/java/com/bonait/bnframework/ui/fragment/silos/MaterialFragment.java
  49. +5
    -2
      app/src/main/java/com/bonait/bnframework/ui/fragment/silos/SilosFragment.java
  50. +15
    -11
      app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java
  51. +18
    -0
      app/src/main/res/drawable/bg_bottom_line.xml
  52. +17
    -0
      app/src/main/res/drawable/bg_round25_red_btn.xml
  53. +2
    -1
      app/src/main/res/layout/activity_cook.xml
  54. +2
    -1
      app/src/main/res/layout/activity_edit_classify.xml
  55. +2
    -1
      app/src/main/res/layout/activity_edit_process.xml
  56. +2
    -1
      app/src/main/res/layout/activity_error_info.xml
  57. +215
    -0
      app/src/main/res/layout/activity_log.xml
  58. +229
    -0
      app/src/main/res/layout/activity_order.xml
  59. +2
    -1
      app/src/main/res/layout/activity_rec_process.xml
  60. +58
    -60
      app/src/main/res/layout/activity_seasoning_set.xml
  61. +4
    -1
      app/src/main/res/layout/activity_system_set.xml
  62. +1
    -1
      app/src/main/res/layout/dialog/layout/dialog_edit_goods.xml
  63. +149
    -0
      app/src/main/res/layout/dialog/layout/dialog_sub_order.xml
  64. +37
    -15
      app/src/main/res/layout/dialog/layout/layout_add_goods_mainfood.xml
  65. +3
    -3
      app/src/main/res/layout/dialog/layout/layout_edit_goods_sub_attribute.xml
  66. +1
    -1
      app/src/main/res/layout/fragment_cloud_goods.xml
  67. +2
    -1
      app/src/main/res/layout/fragment_home_foods.xml
  68. +62
    -9
      app/src/main/res/layout/fragment_home_main.xml
  69. +1
    -1
      app/src/main/res/layout/fragment_local_goods.xml
  70. +17
    -2
      app/src/main/res/layout/fragment_material.xml
  71. +53
    -0
      app/src/main/res/layout/item/layout/item_log.xml
  72. +74
    -0
      app/src/main/res/layout/item/layout/item_order.xml
  73. BIN
     
  74. BIN
     
  75. +2
    -2
      app/src/main/res/values/styles.xml
  76. +2
    -2
      build.gradle

+ 2
- 2
.idea/deploymentTargetSelector.xml View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-05-31T01:56:05.992353200Z">
<DropdownSelection timestamp="2024-06-04T09:46:39.139475300Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="Default" identifier="serial=10.24.61.116:5555;connection=ddfc653b" />
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=14007664" />
</handle>
</Target>
</DropdownSelection>


+ 3
- 1
app/build.gradle View File

@@ -67,7 +67,7 @@ android {
}
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "boluo-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk"
outputFileName = "boluo-xiaochao-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk"
}
}
}
@@ -202,4 +202,6 @@ dependencies {
//腾讯bugly
//sdk地址 https://bugly.qq.com/docs/user-guide/instruction-manual-android/?v=1.0.0
implementation 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如4.0.3
//选择器 时间
implementation 'com.contrarywind:Android-PickerView:3.2.6'
}

+ 10
- 0
app/src/main/AndroidManifest.xml View File

@@ -66,6 +66,16 @@
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".ui.activity.LogRecordActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".ui.activity.OrderRecordActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".ui.activity.ErrorInfoActivity"
android:screenOrientation="portrait"


+ 10
- 0
app/src/main/java/com/bonait/bnframework/Model/OrderRecordBean.java View File

@@ -0,0 +1,10 @@
package com.bonait.bnframework.Model;

public class OrderRecordBean {
public String name;
public String subAttributeNames;
public int Count;
public int errorCount;
public int completeCount;
public int cancelCount;
}

+ 28
- 1
app/src/main/java/com/bonait/bnframework/Model/ProcessValueUtil.java View File

@@ -22,7 +22,16 @@ public class ProcessValueUtil {
HashMap<String,String> map = new HashMap<>();
JSONObject dataJson = array.getJSONObject(i);
if(!dataJson.optString("actionName").equals("执行步骤")){
stringBuffer.append(dataJson.optString("actionName")).append(",").append(dataJson.optString("actionValue")).append("|");
if(dataJson.optString("actionName").equals("加热档位")||dataJson.optString("actionName").equals("搅拌档位") ){
String value = dataJson.optString("actionValue");
if(value.contains("档")){
stringBuffer.append(dataJson.optString("actionName")).append(",").append(dataJson.optString("actionValue")).append("|");
}else{
stringBuffer.append(dataJson.optString("actionName")).append(",").append(dataJson.optString("actionValue")).append("档").append("|");
}
}else {
stringBuffer.append(dataJson.optString("actionName")).append(",").append(dataJson.optString("actionValue")).append("|");
}
}
}
if(stringBuffer.length()>0){
@@ -38,6 +47,24 @@ public class ProcessValueUtil {
return stringBuffer.toString();
}

// public static int dealProcessJsonToSort(String json){
// int sort = 0;
// try{
// JSONArray array = new JSONArray(json);
// for (int i =0 ;i<array.length();i++){
// HashMap<String,String> map = new HashMap<>();
// JSONObject dataJson = array.getJSONObject(i);
// if(dataJson.optString("actionName").equals("执行步骤")){
// sort = Integer.parseInt(dataJson.optString("actionValue"));
// }
// }
// return sort;
// }catch (Exception e){
// e.printStackTrace();
// return 0;
// }
// }

public static String dealProcessSms(String value){
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append("(");


+ 13
- 5
app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/LoginActivity.java View File

@@ -27,6 +27,7 @@ import androidx.lifecycle.LifecycleObserver;
import com.bonait.bnframework.Model.AppLoginPo;
import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ConfigData;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.bg.SnowView;
import com.bonait.bnframework.common.constant.ConfigName;
@@ -40,7 +41,6 @@ import com.bonait.bnframework.common.utils.Des3Utils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.KeyboardToolUtils;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.utils.UpdateAppUtils;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.test.TestActivity;
@@ -208,7 +208,8 @@ public class LoginActivity extends BaseActivity{
* 忘记密码
* */
private void forgotPassword() {
ToastUtils.info("请与管理员联系修改密码!");
NewToastUtil.getInstance().showToast("请与管理员联系修改密码!");
RecordManager.getInstance().addLogRecord("登录日志","忘记密码");
}

// *************************以下为登录验证及跳转界面相关*************************//
@@ -233,7 +234,8 @@ public class LoginActivity extends BaseActivity{
skipToMainActivity();
}else
{
ToastUtils.warning("账号密码不正确!");
NewToastUtil.getInstance().showToastError("账号密码不正确!");
RecordManager.getInstance().addLogRecord("登录日志","账号密码不正确");
}


@@ -374,7 +376,8 @@ public class LoginActivity extends BaseActivity{
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
ToastUtils.info("登录成功!");
NewToastUtil.getInstance().showToast("登录成功!");
RecordManager.getInstance().addLogRecord("登录日志",ConfigName.getInstance().user.name+"-登录成功");
// 结束所有Activity
ActivityLifecycleManager.get().finishAllActivity();
}
@@ -508,7 +511,7 @@ public class LoginActivity extends BaseActivity{
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (System.currentTimeMillis() - exitTime > 2000) {
ToastUtils.normal("再按一次退出程序");
NewToastUtil.getInstance().showToast("再按一次退出程序");
exitTime = System.currentTimeMillis();
} else {
OkGo.getInstance().cancelAll();
@@ -531,4 +534,9 @@ public class LoginActivity extends BaseActivity{
protected void onDestroy() {
super.onDestroy();
}

@Override
protected String getClassName() {
return "登录页";
}
}

+ 4
- 0
app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/WelcomeActivity.java View File

@@ -282,4 +282,8 @@ public class WelcomeActivity extends BaseActivity {
super.onDestroy();
}

@Override
protected String getClassName() {
return "";
}
}

+ 17
- 1
app/src/main/java/com/bonait/bnframework/business/MainInit.java View File

@@ -19,10 +19,13 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_OLD;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_USER;
import com.bonait.bnframework.common.helper.CrashHandler;
import com.bonait.bnframework.common.helper.SdCart;
@@ -236,7 +239,20 @@ public class MainInit {
ConfigData.getInstance().RevertPLCProcess();
// }


if(PreferenceUtils.getInt("reset",1)<3){
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_RECORD.class,null);
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SUBORDER_RECORD.class,null);
PreferenceUtils.setInt("reset",3);
}
if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_SUBORDER_RECORD.class)){
DBHelper.getInstance(MainApplication.getContext()).CreateTablesAll(BPA_SUBORDER_RECORD.class,null);
}
if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_ORDER_RECORD.class)){
DBHelper.getInstance(MainApplication.getContext()).CreateTablesAll(BPA_ORDER_RECORD.class,null);
}
if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_LOG_RECORD.class)){
DBHelper.getInstance(MainApplication.getContext()).CreateTablesAll(BPA_LOG_RECORD.class,null);
}

//11个料仓 1-9个液体 10水阀 11勾芡
// DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SILOS_CALIBRATE.class,null);


+ 147
- 0
app/src/main/java/com/bonait/bnframework/business/RecordManager.java View File

@@ -0,0 +1,147 @@
package com.bonait.bnframework.business;

import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
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.GoodsDBUtil;
import com.bonait.bnframework.common.db.util.OrderRecordUtil;
import com.bonait.bnframework.common.db.util.LogRecordUtil;
import com.bonait.bnframework.common.db.util.SubOrderRecordUtil;

/**
* @author: liup
* @description: 记录管理 日志记录 订单记录
* @date: 2024/6/4 9:20.
*/
public class RecordManager {
private static RecordManager mInstance; //实例变量设置私有,防止直接通过类名访问

public static synchronized RecordManager getInstance() { //静态同步方法作为唯一的实例对象获取方式
if (mInstance == null) {
synchronized (RecordManager.class){
if(mInstance == null){
mInstance = new RecordManager();
}
}
}
return mInstance;
}

/**
* 添加日志记录
* @param typeName
* @param desc
*/
public void addLogRecord(String typeName,String desc){
ThreadManager.get().execute(new Thread(()->{
try{
BPA_LOG_RECORD log = new BPA_LOG_RECORD();
log.userID = ConfigName.getInstance().user.userID;
log.typeName = typeName;
log.describe = desc;
log.userName = ConfigName.getInstance().user.name;
switch (typeName){
case "登录日志":log.typeId=1;
break;
case "角色操作日志":log.typeId=2;
break;
case "数据接收":log.typeId=3;
break;
case "上传日志":log.typeId=4;
break;
case "订单处理日志":log.typeId=5;
break;
case "设备异常日志":log.typeId=6;
break;
case "页面上报日志":log.typeId=7;
break;
}
LogRecordUtil.add(log);
}catch (Exception e){
e.printStackTrace();
}
}));
}

/**
* 添加订单记录
* @param group
* @param type 1完成 2取消 3异常
*/
public void addOrderRecord(BPA_GOODS_SUBATTRIBUTE_GROUP group, String type){
if(group==null||type==null||type.isEmpty()){
return;
}
ThreadManager.get().execute(new Thread(()->{
try{
BPA_ORDER_RECORD bean = OrderRecordUtil.getByGoodsId(group.goodsId);
bean.Count = bean.Count+1;
BPA_GOODS goods = GoodsDBUtil.getById(group.goodsId);
if(goods==null){
return;
}
bean.goodsName = goods.name;
bean.goodsId = goods.id;
bean.classifyId = goods.classifyId;
switch (type){
case "完成":
bean.completeCount = bean.completeCount+1;
break;
case "取消":
bean.cancelCount = bean.cancelCount+1;
break;
case "异常":
bean.errorCount = bean.errorCount+1;
break;
}
OrderRecordUtil.add(bean);
}catch (Exception e){
e.printStackTrace();
}
}));
}

/**
* 添加订单记录
* @param group
* @param type 1完成 2取消 3异常
*/
public void addSubOrderRecord(BPA_GOODS_SUBATTRIBUTE_GROUP group, String type){
if(group==null||type==null||type.isEmpty()){
return;
}
ThreadManager.get().execute(new Thread(()->{
try{
BPA_SUBORDER_RECORD bean = SubOrderRecordUtil.getByGoodsId(group.goodsId,group.id);
bean.subCount = bean.subCount+1;
BPA_GOODS goods = GoodsDBUtil.getById(group.goodsId);
if(goods==null){
return;
}
bean.goodsName = goods.name;
bean.subNames = group.name;
bean.subGoodsId = group.id;
bean.goodsId = goods.id;
bean.classifyId = goods.classifyId;
switch (type){
case "完成":
bean.subCompleteCount = bean.subCompleteCount+1;
break;
case "取消":
bean.subCancelCount = bean.subCancelCount+1;
break;
case "异常":
bean.subErrorCount = bean.subErrorCount+1;
break;
}
SubOrderRecordUtil.add(bean);
}catch (Exception e){
e.printStackTrace();
}
}));
}
}

+ 7
- 0
app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java View File

@@ -14,6 +14,7 @@ import androidx.annotation.Nullable;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.constant.Constants;
import com.bonait.bnframework.common.helper.ActiveMax;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
@@ -118,12 +119,18 @@ public class BaseActivity extends QMUIActivity implements EasyPermissions.Permis
protected void onResume() {
super.onResume();
LogUtils.d(getClassName()+"生命周期 onResume()");
if(getClassName()!=null && !getClassName().isEmpty()){
RecordManager.getInstance().addLogRecord("页面上报日志",getClassName()+"-启动");
}
}

@Override
protected void onPause() {
super.onPause();
LogUtils.d(getClassName()+"生命周期 onPause()");
if(getClassName()!=null && !getClassName().isEmpty()){
RecordManager.getInstance().addLogRecord("页面上报日志",getClassName()+"-退出");
}
}

@Override


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

@@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class ConfigName {
//是否是测试模式
public final static boolean TEST = false;
public final static boolean TEST = true;
//日志打印
public final static boolean LOG_TEST = false;
//region 单例模式


+ 35
- 0
app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java View File

@@ -21,12 +21,14 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODS_OLD;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_LOG;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_MENU;
import com.bonait.bnframework.common.db.mode.BPA_MENUANDUSER;
import com.bonait.bnframework.common.db.mode.BPA_ORDER;
import com.bonait.bnframework.common.db.mode.BPA_ORDERLOG;
import com.bonait.bnframework.common.db.mode.BPA_ORDERLOGDESC;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel;
@@ -35,6 +37,7 @@ import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE;
import com.bonait.bnframework.common.db.mode.BPA_SUBATTRIBUTE;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_SUGAR;
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET;
import com.bonait.bnframework.common.db.mode.BPA_USER;
@@ -2943,6 +2946,38 @@ public class QueryDB {
((BPA_LOG) data).type = cursor.getInt((int) cursor.getColumnIndex("type"));
((BPA_LOG) data).text = cursor.getString((int) cursor.getColumnIndex("text"));
break;
case "BPA_LOG_RECORD":
data = new BPA_LOG_RECORD();
((BPA_LOG_RECORD) data).typeName = cursor.getString((int) cursor.getColumnIndex("typeName"));
((BPA_LOG_RECORD) data).typeId = cursor.getInt((int) cursor.getColumnIndex("typeId"));
((BPA_LOG_RECORD) data).describe = cursor.getString((int) cursor.getColumnIndex("describe"));
((BPA_LOG_RECORD) data).requestPara = cursor.getString((int) cursor.getColumnIndex("requestPara"));
((BPA_LOG_RECORD) data).resultPara = cursor.getString((int) cursor.getColumnIndex("resultPara"));
((BPA_LOG_RECORD) data).level = cursor.getString((int) cursor.getColumnIndex("level"));
((BPA_LOG_RECORD) data).userName = cursor.getString((int) cursor.getColumnIndex("userName"));
break;
case "BPA_ORDER_RECORD":
data = new BPA_ORDER_RECORD();
((BPA_ORDER_RECORD) data).goodsName = cursor.getString((int) cursor.getColumnIndex("goodsName"));
((BPA_ORDER_RECORD) data).goodsId = cursor.getString((int) cursor.getColumnIndex("goodsId"));
((BPA_ORDER_RECORD) data).classifyId = cursor.getString((int) cursor.getColumnIndex("classifyId"));
((BPA_ORDER_RECORD) data).Count = cursor.getInt((int) cursor.getColumnIndex("Count"));
((BPA_ORDER_RECORD) data).errorCount = cursor.getInt((int) cursor.getColumnIndex("errorCount"));
((BPA_ORDER_RECORD) data).completeCount = cursor.getInt((int) cursor.getColumnIndex("completeCount"));
((BPA_ORDER_RECORD) data).cancelCount = cursor.getInt((int) cursor.getColumnIndex("cancelCount"));
break;
case "BPA_SUBORDER_RECORD":
data = new BPA_SUBORDER_RECORD();
((BPA_SUBORDER_RECORD) data).goodsName = cursor.getString((int) cursor.getColumnIndex("goodsName"));
((BPA_SUBORDER_RECORD) data).goodsId = cursor.getString((int) cursor.getColumnIndex("goodsId"));
((BPA_SUBORDER_RECORD) data).classifyId = cursor.getString((int) cursor.getColumnIndex("classifyId"));
((BPA_SUBORDER_RECORD) data).subNames = cursor.getString((int) cursor.getColumnIndex("subNames"));
((BPA_SUBORDER_RECORD) data).subGoodsId = cursor.getString((int) cursor.getColumnIndex("subGoodsId"));
((BPA_SUBORDER_RECORD) data).subCount = cursor.getInt((int) cursor.getColumnIndex("subCount"));
((BPA_SUBORDER_RECORD) data).subErrorCount = cursor.getInt((int) cursor.getColumnIndex("subErrorCount"));
((BPA_SUBORDER_RECORD) data).subCancelCount = cursor.getInt((int) cursor.getColumnIndex("subCancelCount"));
((BPA_SUBORDER_RECORD) data).subCompleteCount = cursor.getInt((int) cursor.getColumnIndex("subCompleteCount"));
break;
case "BPA_ORDERLOG":
data = new BPA_ORDERLOG();
//私有


+ 4
- 0
app/src/main/java/com/bonait/bnframework/common/db/file/DBHelper.java View File

@@ -25,9 +25,11 @@ import com.bonait.bnframework.common.db.mode.BPA_MENUANDUSER;
import com.bonait.bnframework.common.db.mode.BPA_ORDER;
import com.bonait.bnframework.common.db.mode.BPA_ORDERLOG;
import com.bonait.bnframework.common.db.mode.BPA_ORDERLOGDESC;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE;
@@ -110,10 +112,12 @@ public class DBHelper extends SQLiteOpenHelper {
CreateTablesAll(BPA_GOODSRECIPE.class,null);//商品配方明细表

CreateTablesAll(BPA_ORDER.class,null);//订单表
CreateTablesAll(BPA_ORDER_RECORD.class,null);//订单表
CreateTablesAll(BPA_SUBORDER.class,null);//订单子表

CreateTablesAll(BPA_ALERTLOG.class,null);//预警日志表
CreateTablesAll(BPA_LOG.class,null);//日志表
CreateTablesAll(BPA_LOG_RECORD.class,null);//日志表
CreateTablesAll(BPA_ORDERLOG.class,null);//订单制作记录表
CreateTablesAll(BPA_ORDERLOGDESC.class,null);//订单制作记录描述表



+ 2
- 0
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_LOG.java View File

@@ -12,6 +12,8 @@ public class BPA_LOG extends ModeBase{
* 3 数据接收
* 4 上传日志
* 5 订单处理日志
* 6 设备异常日志
* 7 页面上报日志
*/
public int type;
//日志描述


+ 26
- 0
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_LOG_RECORD.java View File

@@ -0,0 +1,26 @@
package com.bonait.bnframework.common.db.mode;

/**
* @author: liup
* @description: 记录日志
* @date: 2024/6/4 9:32.
*/
public class BPA_LOG_RECORD extends ModeBase{
/**
* 类型:
* 1 登录日志、
* 2 角色操作日志、
* 3 数据接收
* 4 上传日志
* 5 订单处理日志
* 6 设备异常日志
* 7 页面上报日志
*/
public String typeName;
public int typeId;
public String describe;//日志描述
public String requestPara;//请求参数
public String resultPara;//响应参数
public String level;//日志级别
public String userName;//用户名
}

+ 29
- 0
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_ORDER_RECORD.java View File

@@ -0,0 +1,29 @@
package com.bonait.bnframework.common.db.mode;

/**
* @author: liup
* @description: 订单记录
* @date: 2024/6/3 17:36.
*/
public class BPA_ORDER_RECORD extends ModeBase{
public String goodsName;
public String goodsId;
public String classifyId;
public int Count=0;
public int errorCount=0;
public int completeCount=0;
public int cancelCount=0;

@Override
public String toString() {
return "BPA_ORDER_RECORD{" +
"goodsName='" + goodsName + '\'' +
", goodsId='" + goodsId + '\'' +
", classifyId='" + classifyId + '\'' +
", Count=" + Count +
", errorCount=" + errorCount +
", completeCount=" + completeCount +
", cancelCount=" + cancelCount +
'}';
}
}

+ 33
- 0
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_SUBORDER_RECORD.java View File

@@ -0,0 +1,33 @@
package com.bonait.bnframework.common.db.mode;

/**
* @author: liup
* @description: 子订单记录
* @date: 2024/6/3 17:36.
*/
public class BPA_SUBORDER_RECORD extends ModeBase{
public String goodsName;
public String goodsId;
public String classifyId;
public String subNames;
public String subGoodsId;
public int subCount = 0;
public int subErrorCount = 0;
public int subCancelCount = 0;
public int subCompleteCount = 0;

@Override
public String toString() {
return "BPA_SUBORDER_RECORD{" +
"goodsName='" + goodsName + '\'' +
", goodsId='" + goodsId + '\'' +
", classifyId='" + classifyId + '\'' +
", subNames='" + subNames + '\'' +
", subCount=" + subCount +
", subGoodsId=" + subGoodsId +
", subErrorCount=" + subErrorCount +
", subCancelCount=" + subCancelCount +
", subCompleteCount=" + subCompleteCount +
'}';
}
}

+ 15
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/GoodsProcessDetailDBUtil.java View File

@@ -223,4 +223,19 @@ public class GoodsProcessDetailDBUtil {
LogUtils.d("deleteByGoodsId 根据商品id删除配料信息 result=" + result);
return result;
}

/**
* 根据商品id删除配料信息
*
* @param groupId
* @return
*/
public static Boolean deleteByeGroupId(String groupId) {
SQLiteDatabase db = DBHelper.getInstance(ConfigName.getInstance().dishesCon).getWritableDatabase();
long delete = db.delete(BPA_GOODS_PROCESS_DETAIL.class.getSimpleName(), "goodsSubAttributeGroupId=?",
new String[]{groupId});
db.close();
LogUtils.d("deleteByeGroupId 根据商品id删除配料信息 delete=" + delete);
return delete>0;
}
}

+ 69
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/LogRecordUtil.java View File

@@ -0,0 +1,69 @@
package com.bonait.bnframework.common.db.util;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;

import java.util.ArrayList;

/**
* @author: liup
* @description:
* @date: 2024/6/4 9:40.
*/
public class LogRecordUtil {
/**
* 新增日志数据
* @return 是否成功
*/
public static boolean add(BPA_LOG_RECORD data) {
return QueryDB.Add(BPA_LOG_RECORD.class, data);
}

/**
* 修改日志数据
* @param data
*/
public static void update(BPA_LOG_RECORD data) {
QueryDB.Update(BPA_LOG_RECORD.class, data);
}

/**
* 删除日志数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean delete(BPA_LOG_RECORD data) {
return QueryDB.Delete(BPA_LOG_RECORD.class, data.id);
}

/**
* 根据时间 模糊查询 获取日志
* @return
*/
public static ArrayList<BPA_LOG_RECORD> getLogByFilter(String sta, String stp, String typeName, String describe) {
String orderby = QueryDB.Desc_Time_Down;//先按排序 创建时间倒序
String where = "isDelete=? and createTime>=? and createTime<=?";
LogUtils.d("getLogByFilter 获取日志 startTime=" +sta+";stopTime="+stp+";typeName="+typeName+";describe="+describe);
String[] args = new String[]{"0", sta, stp};
if (typeName!=null && !typeName.isEmpty()) {
where = "isDelete=? and createTime>=? and createTime<=? and typeName=?";
args = new String[]{"0", sta, stp, typeName};
if (!describe.isEmpty()) {
where = "isDelete=? and createTime>=? and createTime<=? and describe like ? and typeName=?";
args = new String[]{"0", sta, stp, "%" + describe + "%", typeName};
}
} else {
if (!describe.isEmpty()) {
where = "isDelete=? and createTime>=? and createTime<=? and describe like ?";
args = new String[]{"0", sta, stp, "%" + describe + "%"};
}
}
ArrayList<BPA_LOG_RECORD> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_LOG_RECORD.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_LOG_RECORD) k);
}
return data;
}
}

+ 77
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/OrderRecordUtil.java View File

@@ -0,0 +1,77 @@
package com.bonait.bnframework.common.db.util;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;

import java.util.ArrayList;

/**
* @author: liup
* @description: 订单
* @date: 2024/6/3 17:46.
*/
public class OrderRecordUtil {
/**
* 新增订单数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean add(BPA_ORDER_RECORD data) {

return QueryDB.Add(BPA_ORDER_RECORD.class, data);
}

/**
* 修改订单数据
* @param data
*/
public static void update(BPA_ORDER_RECORD data) {
QueryDB.Update(BPA_ORDER_RECORD.class, data);
}

/**
* 删除订单数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean delete(BPA_ORDER_RECORD data) {
return QueryDB.Delete(BPA_ORDER_RECORD.class, data.id);
}

/**
* 获取订单数据
*/
public static BPA_ORDER_RECORD getByGoodsId(String goodsId){
String orderby = QueryDB.Desc_Time_Up;
String where = "goodsId=?";
String[] args = new String[]{goodsId};
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_RECORD.class, where, args, orderby);

return obj.size() > 0 ? (BPA_ORDER_RECORD) obj.get(0) : new BPA_ORDER_RECORD();
}

/**
* 获取所有订单数据
*
* @return ArrayList<BPA_GOODS_CLASSIFY>
*/
public static ArrayList<BPA_ORDER_RECORD> getAll(String startTime,String stopTime,String text) {
String orderby = QueryDB.Desc_Time_Down;
LogUtils.d("getAll 获取所有订单数据 startTime=" +startTime+";stopTime="+stopTime+";text="+text);
String where = "isDelete=? and createTime>=? and createTime<=?";
String[] args = new String[]{"0",startTime,stopTime};
if (!text.isEmpty()) {
where = "isDelete=? and createTime>=? and createTime<=? and goodsName like ?";
args = new String[]{"0", startTime, stopTime, "%" + text + "%"};
}

ArrayList<BPA_ORDER_RECORD> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_RECORD.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_ORDER_RECORD) k);
}
LogUtils.d("getAll 获取所有订单数据 data=" + data.toString());
return data;
}
}

+ 20
- 1
app/src/main/java/com/bonait/bnframework/common/db/util/SubAttributeGroupDBUtil.java View File

@@ -145,6 +145,25 @@ public class SubAttributeGroupDBUtil {
return result;
}

/**
* 删除子属性组合数据
*
* @param id
* @return 是否成功
*/
public static boolean deleteById(String id) {
boolean result = true;
SQLiteDatabase db = DBHelper.getInstance(ConfigName.getInstance().dishesCon).getWritableDatabase();
long delete = db.delete(BPA_GOODS_SUBATTRIBUTE_GROUP.class.getSimpleName(), "id=?",
new String[]{id});
if(delete <= 0){
result = false;
}
db.close();
LogUtils.d("deleteById 删除子属性组合数据 result=" + result);
return result;
}

/**
* @param id
* @return BPA_GOODS_SUBATTRIBUTE_GROUP
@@ -182,7 +201,7 @@ public class SubAttributeGroupDBUtil {
String where = "isDelete=? and goodsId=? and subAttributeIdList=?";
String[] args = new String[]{"0",goodsId, subAttributeIdList};
ArrayList<Object> obj = QueryDB.Get(BPA_GOODS_SUBATTRIBUTE_GROUP.class, where, args, orderby);
LogUtils.d("getByGoodIdAndListId goodsId=" + goodsId+" subAttributeIdList="+subAttributeIdList);
return obj.size() > 0 ? (BPA_GOODS_SUBATTRIBUTE_GROUP) obj.get(0) : null;
}



+ 77
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/SubOrderRecordUtil.java View File

@@ -0,0 +1,77 @@
package com.bonait.bnframework.common.db.util;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;

import java.util.ArrayList;

/**
* @author: liup
* @description: 订单
* @date: 2024/6/3 17:46.
*/
public class SubOrderRecordUtil {
/**
* 新增订单数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean add(BPA_SUBORDER_RECORD data) {

return QueryDB.Add(BPA_SUBORDER_RECORD.class, data);
}

/**
* 修改订单数据
* @param data
*/
public static void update(BPA_SUBORDER_RECORD data) {
QueryDB.Update(BPA_SUBORDER_RECORD.class, data);
}

/**
* 删除订单数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean delete(BPA_SUBORDER_RECORD data) {
return QueryDB.Delete(BPA_SUBORDER_RECORD.class, data.id);
}

/**
* 获取订单数据
*/
public static BPA_SUBORDER_RECORD getByGoodsId(String goodsId,String subGoodsId){
String orderby = QueryDB.Desc_Time_Up;
String where = "goodsId=? and subGoodsId=?";
String[] args = new String[]{goodsId,subGoodsId};
ArrayList<Object> obj = QueryDB.Get(BPA_SUBORDER_RECORD.class, where, args, orderby);

return obj.size() > 0 ? (BPA_SUBORDER_RECORD) obj.get(0) : new BPA_SUBORDER_RECORD();
}

/**
* 获取商品所有子订单数据
*
* @return ArrayList<BPA_GOODS_CLASSIFY>
*/
public static ArrayList<BPA_SUBORDER_RECORD> getByGoodsId(String goodsId, String startTime, String stopTime,String text) {
String orderby = QueryDB.Desc_Time_Down;
String where = "isDelete=? and goodsId=? and createTime>=? and createTime<=?";
String[] args = new String[]{"0",goodsId,startTime,stopTime};
LogUtils.d("getByGoodsId 获取商品所有子订单数据 goodsId=" + goodsId);
if (!text.isEmpty()) {
where = "isDelete=? and goodsId=? and createTime>=? and createTime<=? and goodsName like ?";
args = new String[]{"0",goodsId, startTime, stopTime, "%" + text + "%"};
}
ArrayList<BPA_SUBORDER_RECORD> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_SUBORDER_RECORD.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_SUBORDER_RECORD) k);
}
LogUtils.d("getByGoodsId 获取商品所有子订单数据 data=" + data.toString());
return data;
}

}

+ 2
- 0
app/src/main/java/com/bonait/bnframework/common/image/MyBitmapUtils.java View File

@@ -2,6 +2,7 @@ package com.bonait.bnframework.common.image;

import android.widget.ImageView;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.image.utils.LocalCacheUtils;
import com.bonait.bnframework.common.image.utils.NetCacheUtils;
@@ -43,6 +44,7 @@ public class MyBitmapUtils {
//网络缓存
if(url.contains("http"))
{
LogUtils.d("disPlay getBitmapFromNet url="+url);
mNetCacheUtils.getBitmapFromNet(ivPic,url);
}
}


+ 2
- 1
app/src/main/java/com/bonait/bnframework/common/image/utils/LocalCacheUtils.java View File

@@ -48,10 +48,11 @@ public class LocalCacheUtils {
imgUrl = url;
}
}
LogUtils.d("SetBitmapFile imgUrl="+imgUrl+" name="+name);
if (null != file && file.exists()) {
try {
LogUtils.d("加载图片");
Glide.with(ivPic.getContext()).load(imgUrl==null?file:imgUrl)
Glide.with(ivPic.getContext()).load(file)//imgUrl==null?file:imgUrl
//.override(width, height)
// .thumbnail(0.1f) // 加载原始图片的10%作为缩略图
.fitCenter() // 缩放图片以适应ImageView的尺寸


+ 30
- 5
app/src/main/java/com/bonait/bnframework/ui/activity/CookingActivity.java View File

@@ -17,6 +17,7 @@ import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.R;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.business.NewExecuteTheRecipe;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
@@ -124,7 +125,7 @@ public class CookingActivity extends BaseActivity {
BPA_GOODS goods = GoodsDBUtil.getById(goodId);
LogUtils.d(TAG+"initView goodId= "+goodId +" goods="+goods);
if(goods!=null){
String name = subAttributeGroupName.isEmpty()?goods.name:(goods.name+"-"+subAttributeGroupName);
String name = (subAttributeGroupName.isEmpty()||subAttributeGroupName.equals(goods.name))?goods.name:(goods.name+"-"+subAttributeGroupName);
viewBinding.goodname.setText(name);
}
viewBinding.startGoodmake.setOnClickListener(v->{
@@ -233,8 +234,10 @@ public class CookingActivity extends BaseActivity {
if (NewExecuteTheRecipe.IsStart && goodsSubattributeGroup != null) {
ModbusHelper.get().reset();
long startTime= System.currentTimeMillis(); //起始时间
boolean isError = false;
boolean hasError = false;//设备有异常报警
boolean isError = false;//执行异常
try {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-开始制作");
//获取工艺
ArrayList<BPA_GOODS_PROCESS_DETAIL> goodsrecipes = GoodsProcessDetailDBUtil.getByGroupId(goodsSubattributeGroup.id);
LogUtils.d("制作线程 MakeThread 启动 ==》 菜品配方 goodsrecipes="+goodsrecipes.toString());
@@ -250,7 +253,7 @@ public class CookingActivity extends BaseActivity {
if(!isTest){
if(ModbusHelper.get().isBtnStop()){
NewToastUtil.getInstance().showToastBottom("设备已急停,请关闭急停按钮再调试!");
isError = true;
hasError = true;
break;
}
if(ModbusHelper.get().hasErrorInfo()){
@@ -262,7 +265,7 @@ public class CookingActivity extends BaseActivity {
onErrorDialog();
}
});
isError = true;
hasError = true;
break;
}
}
@@ -278,10 +281,27 @@ public class CookingActivity extends BaseActivity {
}
LogUtils.d("制作线程 MakeThread 结束 ==》 菜品配方 goodsrecipes="+goodsrecipes.toString());
} catch (Exception ex) {
isError = true;
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
if(!isTest){
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作异常");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"异常");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"异常");
}
} finally {
isMaking = false;
if(!isError && !isTest){
if(NewExecuteTheRecipe.IsForcedEnd){
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作强行停止");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"取消");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"取消");
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作完成");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"完成");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"完成");
}
}
if (!NewExecuteTheRecipe.IsForcedEnd && !ModbusHelper.get().hasErrorInfo() && NewExecuteTheRecipe.IsStart && !isTest){
long endTime = System.currentTimeMillis(); //结束时间
int time=(int) ((endTime-startTime)/1000);
@@ -292,7 +312,7 @@ public class CookingActivity extends BaseActivity {
NewExecuteTheRecipe.IsStart = false;

ModbusHelper.get().reset();
boolean finalIsError = isError;
boolean finalIsError = hasError;
if(handler!=null){
handler.post(new Runnable() {
@Override
@@ -575,4 +595,9 @@ public class CookingActivity extends BaseActivity {
}
});
}

@Override
protected String getClassName() {
return "菜品烹饪页";
}
}

+ 13
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java View File

@@ -16,6 +16,7 @@ import androidx.core.content.ContextCompat;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.CustomView.item_gx;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
@@ -128,7 +129,7 @@ public class DiyProcessActivity extends BaseActivity {
private void initView(){
BPA_GOODS goods = GoodsDBUtil.getById(goodId);
if(goods!=null){
viewBinding.title.setText(subAttributeGroupName.isEmpty() ? goods.name:(goods.name+"——"+subAttributeGroupName));
viewBinding.title.setText((subAttributeGroupName.isEmpty()||subAttributeGroupName.equals(goods.name)) ? goods.name:(goods.name+"——"+subAttributeGroupName));
}
initProcessModel();
initStepAdapter();
@@ -268,6 +269,7 @@ public class DiyProcessActivity extends BaseActivity {
if(!processDetails.isEmpty()){
updateProcessSpinner(processDetails.get(0));
}
RecordManager.getInstance().addLogRecord("角色操作日志",subAttributeGroupName+"-导入工序");
}
});
attributeSelectDialog.show(getSupportFragmentManager(),"导入工序dialog");
@@ -328,6 +330,7 @@ public class DiyProcessActivity extends BaseActivity {
* 添加工序
*/
private void addProcess(){
RecordManager.getInstance().addLogRecord("角色操作日志", subAttributeGroupName+"-添加工序");
BPA_GOODS_PROCESS_DETAIL goodsrecipe = getSelectItemFromValue();
if (goodsrecipe != null) {
BPA_GOODS_PROCESS_DETAIL processDetail = getSelectItemFromValue();
@@ -344,6 +347,7 @@ public class DiyProcessActivity extends BaseActivity {
* 向上插入工序
*/
private void insertUpProcess(){
RecordManager.getInstance().addLogRecord("角色操作日志", subAttributeGroupName+"-向上插入工序");
BPA_GOODS_PROCESS_DETAIL goodSrecipeUp = getSelectItemFromValue();
if (goodSrecipeUp != null) {
int index_update = stepAdapter.getCurrentPosition();
@@ -363,6 +367,7 @@ public class DiyProcessActivity extends BaseActivity {
* 向下插入工序
*/
private void insertDownProcess(){
RecordManager.getInstance().addLogRecord("角色操作日志", subAttributeGroupName+"-向下插入工序");
BPA_GOODS_PROCESS_DETAIL goodSrecipeUp = getSelectItemFromValue();
if (goodSrecipeUp != null) {
int index_update = stepAdapter.getCurrentPosition();
@@ -382,6 +387,7 @@ public class DiyProcessActivity extends BaseActivity {
* 修改工序
*/
private void updateProcess(){
RecordManager.getInstance().addLogRecord("角色操作日志", subAttributeGroupName+"-修改工序");
int index_update = stepAdapter.getCurrentPosition();
if (index_update >= 0 && index_update < processDetails.size()) {
BPA_GOODS_PROCESS_DETAIL obj_update = (BPA_GOODS_PROCESS_DETAIL) processDetails.get(index_update);
@@ -402,6 +408,7 @@ public class DiyProcessActivity extends BaseActivity {
* 删除工序
*/
private void deleteProcess(){
RecordManager.getInstance().addLogRecord("角色操作日志", subAttributeGroupName+"-删除工序");
int index_delete = stepAdapter.getCurrentPosition();
if (index_delete >= 0 && index_delete < processDetails.size()) {
BPA_GOODS_PROCESS_DETAIL processDetail = (BPA_GOODS_PROCESS_DETAIL) processDetails.get(index_delete);
@@ -707,4 +714,9 @@ public class DiyProcessActivity extends BaseActivity {
LogUtils.d(TAG+" onPause2");
super.onPause();
}

@Override
protected String getClassName() {
return "编辑工序页";
}
}

+ 68
- 40
app/src/main/java/com/bonait/bnframework/ui/activity/EditClassifyActivity.java View File

@@ -12,9 +12,12 @@ import androidx.annotation.Nullable;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.db.mode.BPA_ATTRIBUTE;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_CLASSIFY;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_SUBATTRIBUTE;
import com.bonait.bnframework.common.db.util.AttributeDBUtil;
import com.bonait.bnframework.common.db.util.GoodsClassifyDBUtil;
@@ -124,7 +127,11 @@ public class EditClassifyActivity extends BaseActivity {

}


/**
* 初始化
* 修改子属性
* 删除子属性
*/
private void initView(){
attributeAdapter = new AttributeAdapter(context, R.layout.item_attribute, attributeList, new MyClickListener() {
@Override
@@ -150,6 +157,7 @@ public class EditClassifyActivity extends BaseActivity {
subattributeAdapter = new SubattributeAdapter(context, R.layout.item_subattribute, subattributeList, new SubattributeAdapter.MyClickListener() {
@Override
public void clickName(View v,int position,BPA_SUBATTRIBUTE data) {
//修改子属性
AlertDialogUtils.showCancelAndConfirmDialog(EditClassifyActivity.this, R.layout.dialog_add_classify, (layoutView, xCom) -> {
DialogAddClassifyBinding binding = DialogAddClassifyBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
@@ -165,14 +173,26 @@ public class EditClassifyActivity extends BaseActivity {
return;
}
}
BPA_SUBATTRIBUTE subattribute = (BPA_SUBATTRIBUTE)data;
subattribute.name = input;
SubAttributeDBUtil.update(subattribute);
xCom.dismissX();
String oldName = data.name;
data.name = input;
SubAttributeDBUtil.update(data);
String classifyId = classifyList.get(viewBinding.spinnerClassify.getSelectedItem().toString());
for(BPA_GOODS goods:GoodsDBUtil.getByClassifyId(classifyId)){
if(goods!=null){
for(BPA_GOODS_SUBATTRIBUTE_GROUP group : SubAttributeGroupDBUtil.getByGoodsId(goods.id)){
if(group.name!=null && group.name.contains(oldName)){
group.name = group.name.replace(oldName,input);
SubAttributeGroupDBUtil.update(group);
}
}
}
}
NewToastUtil.getInstance().showToast("修改成功");
subattributeAdapter.notifyDataSetChanged();
if(position-1>=0 && !subattributeList.isEmpty()){
viewBinding.listSubattribute.smoothScrollToPosition(position-1);
}
xCom.dismissX();
}else {
NewToastUtil.getInstance().showToast("名称不能为空!");
}
@@ -182,7 +202,7 @@ public class EditClassifyActivity extends BaseActivity {

@Override
public void clickDelete(View v,int position,BPA_SUBATTRIBUTE data) {
//删除
//删除子属性
removeSubAttribute(position,data);
}
});
@@ -280,9 +300,10 @@ public class EditClassifyActivity extends BaseActivity {
spinnerAdapter.notifyDataSetChanged();

selectClassify(classifyList.size()-1);//更新数据
NewToastUtil.getInstance().showToast("添加["+input+"]成功!");
NewToastUtil.getInstance().showToast("添加["+input+"]分类成功!");
RecordManager.getInstance().addLogRecord("角色操作日志", "添加["+input+"]分类成功!");
}else {
NewToastUtil.getInstance().showToast("添加["+input+"]失败!");
NewToastUtil.getInstance().showToast("添加["+input+"]分类失败!");
}
xCom.dismissX();
}else {
@@ -326,7 +347,8 @@ public class EditClassifyActivity extends BaseActivity {
classifyNameList.addAll(classifyList.keySet());
spinnerAdapter.notifyDataSetChanged();
selectClassify(classifyList.size()-1);//更新数据

RecordManager.getInstance().addLogRecord("角色操作日志", "修改["+input+"]分类成功!");
NewToastUtil.getInstance().showToast("修改["+input+"]分类成功!");
xCom.dismissX();
}else {
NewToastUtil.getInstance().showToast("名称不能为空!");
@@ -363,10 +385,11 @@ public class EditClassifyActivity extends BaseActivity {
classifyNameList.addAll(classifyList.keySet());
spinnerAdapter.notifyDataSetChanged();
selectClassify(classifyPosition-1);//更新数据
NewToastUtil.getInstance().showToast("删除["+classifyName+"]成功!");
NewToastUtil.getInstance().showToast("删除["+classifyName+"]分类成功!");
RecordManager.getInstance().addLogRecord("角色操作日志", "删除["+classifyName+"]分类成功!");
xCom.dismissX();
}else {
NewToastUtil.getInstance().showToast("删除["+classifyName+"]失败!");
NewToastUtil.getInstance().showToast("删除["+classifyName+"]分类失败!");
}
});
});
@@ -425,6 +448,7 @@ public class EditClassifyActivity extends BaseActivity {
attributeAdapter.notifyDataSetChanged();
subattributeList.clear();
subattributeAdapter.notifyDataSetChanged();
RecordManager.getInstance().addLogRecord("角色操作日志", "新增["+input+"]属性成功!");
}else {
NewToastUtil.getInstance().showToast("名称不能为空!");
}
@@ -439,8 +463,8 @@ public class EditClassifyActivity extends BaseActivity {
if(classifyPosition==0){
return;
}
String classifyId = classifyList.get(viewBinding.spinnerClassify.getSelectedItem().toString());
if(GoodsDBUtil.getClassifyId(classifyId)!=null){
String classifyId1 = classifyList.get(viewBinding.spinnerClassify.getSelectedItem().toString());
if(GoodsDBUtil.getClassifyId(classifyId1)!=null){
AlertDialogUtils.showTipDialog(this, "警告", "删除属性将会影响当前分类下所有菜品,请确保该分类下没有商品再操作",
new AlertDialogUtils.DialogClickListener() {
@Override
@@ -453,32 +477,33 @@ public class EditClassifyActivity extends BaseActivity {
});
return;
}
// if(attributePosition>=0&&attributePosition<attributeList.size()){
// BPA_ATTRIBUTE attribute = attributeList.get(attributePosition);
// //判断是否绑定了属性
// List<BPA_SUBATTRIBUTE> subattributes = SubAttributeDBUtil.getByParentAttributeId(attribute.id);
// for(BPA_SUBATTRIBUTE bean : subattributes){
// String classifyId = classifyList.get(viewBinding.spinnerClassify.getSelectedItem().toString());
// String goodName = SubAttributeGroupDBUtil.isIncludeByClassify(classifyId,bean.name);
// if(!goodName.isEmpty()){
// NewToastUtil.getInstance().showToast("商品["+goodName+"]正在使用["+bean.name+"]属性,请先删除对应商品");
// return;
// }
// }
// AttributeDBUtil.delete(attribute);
// if(attributePosition-1>=0){
// attributeList.remove(attributePosition);
// attributePosition = attributePosition-1;
// attributeAdapter.setSelectPosition(attributePosition);
// subattributeList.clear();
// subattributeList.addAll(SubAttributeDBUtil.getByParentAttributeId(attributeList.get(attributePosition).id));
// }else {
// attributeList.clear();
// subattributeList.clear();
// }
// attributeAdapter.notifyDataSetChanged();
// subattributeAdapter.notifyDataSetChanged();
// }
if(attributePosition>=0&&attributePosition<attributeList.size()){
BPA_ATTRIBUTE attribute = attributeList.get(attributePosition);
//判断是否绑定了属性
List<BPA_SUBATTRIBUTE> subattributes = SubAttributeDBUtil.getByParentAttributeId(attribute.id);
for(BPA_SUBATTRIBUTE bean : subattributes){
String classifyId = classifyList.get(viewBinding.spinnerClassify.getSelectedItem().toString());
String goodName = SubAttributeGroupDBUtil.isIncludeByClassify(classifyId,bean.name);
if(!goodName.isEmpty()){
NewToastUtil.getInstance().showToast("商品["+goodName+"]正在使用["+bean.name+"]属性,请先删除对应商品");
return;
}
}
AttributeDBUtil.delete(attribute);
RecordManager.getInstance().addLogRecord("角色操作日志", "删除["+attribute.name+"]属性成功!");
if(attributePosition-1>=0){
attributeList.remove(attributePosition);
attributePosition = attributePosition-1;
attributeAdapter.setSelectPosition(attributePosition);
subattributeList.clear();
subattributeList.addAll(SubAttributeDBUtil.getByParentAttributeId(attributeList.get(attributePosition).id));
}else {
attributeList.clear();
subattributeList.clear();
}
attributeAdapter.notifyDataSetChanged();
subattributeAdapter.notifyDataSetChanged();
}
}

/**
@@ -507,6 +532,7 @@ public class EditClassifyActivity extends BaseActivity {
BPA_ATTRIBUTE attribute = attributeList.get(attributePosition);
attribute.name = input;
AttributeDBUtil.update(attribute);
RecordManager.getInstance().addLogRecord("角色操作日志", "修改["+attribute.name+"]属性成功!");
attributeAdapter.notifyDataSetChanged();
xCom.dismissX();
}else {
@@ -551,6 +577,7 @@ public class EditClassifyActivity extends BaseActivity {
subattributeList.add(subattribute);
subattributeAdapter.notifyDataSetChanged();
viewBinding.listSubattribute.smoothScrollToPosition(subattributeList.size()-1);
RecordManager.getInstance().addLogRecord("角色操作日志", "新增["+subattribute.name+"]子属性成功!");
}else {
NewToastUtil.getInstance().showToast("名称不能为空!");
}
@@ -572,6 +599,7 @@ public class EditClassifyActivity extends BaseActivity {
return;
}
SubAttributeDBUtil.delete(bean);
RecordManager.getInstance().addLogRecord("角色操作日志", "删除["+bean.name+"]子属性成功!");
subattributeList.remove(position);
if(position-1>=0 && !subattributeList.isEmpty()){
viewBinding.listSubattribute.smoothScrollToPosition(position-1);
@@ -600,6 +628,6 @@ public class EditClassifyActivity extends BaseActivity {

@Override
protected String getClassName() {
return TAG;
return "编辑分类页";
}
}

+ 4
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/EditGoodsActivity.java View File

@@ -176,4 +176,8 @@ public class EditGoodsActivity extends BaseActivity {
EventBus.getDefault().post(new FreshLocalGoodsEvent());
}

@Override
protected String getClassName() {
return "菜品管理页";
}
}

+ 7
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/ErrorInfoActivity.java View File

@@ -20,6 +20,7 @@ import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.Model.ErrorCodeBean;
import com.bonait.bnframework.R;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
@@ -74,6 +75,7 @@ public class ErrorInfoActivity extends BaseActivity {
AlertDialogUtils.showTipDialog(this, "温馨提示!", "请观察升降台和搅拌爪情况再点击复位哦!", new AlertDialogUtils.DialogClickListener() {
@Override
public void onConfirm() {
RecordManager.getInstance().addLogRecord("角色操作日志","设备异常信息页-一键复位");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().setErrorReset();
}));
@@ -149,4 +151,9 @@ public class ErrorInfoActivity extends BaseActivity {
}
finish();
}

@Override
protected String getClassName() {
return "设备异常信息页";
}
}

+ 202
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/LogRecordActivity.java View File

@@ -0,0 +1,202 @@
package com.bonait.bnframework.ui.activity;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.bigkoo.pickerview.TimePickerView;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.util.LogRecordUtil;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivityLogBinding;
import com.bonait.bnframework.ui.adapter.LocalLogAdapter;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
* 日志页面
*/
public class LogRecordActivity extends BaseActivity {
private ActivityLogBinding viewBinding;
/**
* 日志数据
*/
ArrayList<BPA_LOG_RECORD> dataLogs = new ArrayList<>();
private LocalLogAdapter adapter;
/**
* 日志类型
*/
List<String> typeMap = new ArrayList<>();
private TimePickerView pvTime;

private ViewGroup view;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
viewBinding = ActivityLogBinding.inflate(getLayoutInflater());
setContentView(viewBinding.getRoot());
view=(ViewGroup)getWindow().getDecorView();
DisplayManager.scaleViewGroup(viewBinding.getRoot());
initTopBar();
Init();
}

private void initTopBar() {
viewBinding.btnQuery.requestFocus();
viewBinding.topbar.setTitle("日志记录");
viewBinding.back.setOnClickListener(v->{
finish();
});
}

/**
* 初始化
*/
@SuppressLint("SimpleDateFormat")
private void Init(){

typeMap.add("全部日志");
typeMap.add("登录日志");
typeMap.add("角色操作日志");
typeMap.add("数据接收");
typeMap.add("上传日志");
typeMap.add("订单处理日志");
// typeMap.add("设备异常日志");
typeMap.add("页面上报日志");

viewBinding.btnQuery.setOnClickListener(v->{
Initdata();
});

ArrayAdapter<String> adapter2 = new ArrayAdapter<>(this, R.layout.spinner_text_item,typeMap);
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinner.setAdapter(adapter2);
viewBinding.starttime.setText( new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date()));
viewBinding.stoptime.setText(new SimpleDateFormat("yyyy-MM-dd 23:59:59").format(new Date()));
viewBinding.starttime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (pvTime != null) {
pvTime.show(viewBinding.starttime);
}
}
});
viewBinding.stoptime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (pvTime != null) {
pvTime.show(viewBinding.stoptime);
}
}
});

adapter = new LocalLogAdapter();
adapter.setNewData(dataLogs);
viewBinding.recycleView.setAdapter(adapter);


CalendarTime();
Initdata();
}
/**
* CalendarTime
* 时间选择器
*/
public void CalendarTime() {
//控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释)
//因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
Calendar selectedDate = Calendar.getInstance();
Calendar startDate = Calendar.getInstance();
startDate.set(2023, 0, 23);
Calendar endDate = Calendar.getInstance();
endDate.set(2099, 11, 28);
//时间选择器
pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View v) {//选中事件回调
// 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null
TextView btn = (TextView) v;
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
btn.setText(time.replace(" ","\n"));
}
})
//年月日时分秒 的显示与否,不设置则默认全部显示
.setType(new boolean[]{true, true, true, true, true, false})
.setLabel("年", "月", "日", "时", "分", "秒")
.isCenterLabel(true)
.setDividerColor(Color.DKGRAY)
.setContentSize(26)//字号
.setDate(selectedDate)
.setRangDate(startDate, endDate)
.setDecorView(view)
.build();


}


/**
* 初始化数据加载
*/
public void Initdata() {
try {
if(DateUtils.compareDate( viewBinding.stoptime.getText().toString(),viewBinding.starttime.getText().toString()))
{
ToastUtils.warning("开始时间不能大于结束时间!!!");
return;
}
String lx= viewBinding.spinner.getSelectedItem().toString();
String text= viewBinding.edittext.getText().toString();
dataLogs.clear();
if(lx.equals("全部日志")){
dataLogs.addAll(LogRecordUtil.getLogByFilter(viewBinding.starttime.getText().toString(), viewBinding.stoptime.getText().toString(), "",text));
}else {
dataLogs.addAll(LogRecordUtil.getLogByFilter(viewBinding.starttime.getText().toString(), viewBinding.stoptime.getText().toString(), lx,text));
}
adapter.notifyDataSetChanged();

} catch (Exception e) {

}
}

@Override
public void onDestroy() {
super.onDestroy();
if(dataLogs!=null){
dataLogs.clear();
dataLogs = null;
}
if(adapter!=null){
adapter = null;
}
viewBinding.recycleView.setAdapter(null);
viewBinding.spinner.setAdapter(null);
if(typeMap!=null){
typeMap.clear();
typeMap = null;
}
}

@Override
protected boolean canDragBack() {
return false;
}

@Override
protected String getClassName() {
return "日志记录页";
}
}

+ 17
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/MainActivity.java View File

@@ -10,14 +10,18 @@ import androidx.viewpager.widget.ViewPager;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.ViewModel.Adapter.FragmentAdapter;
import com.bonait.bnframework.business.ConfigData;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivityMainBinding;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
@@ -45,6 +49,15 @@ public class MainActivity extends BaseActivity {
Init();
initFragment();
initView();
int loginNum = PreferenceUtils.getInt("loginNum",0);
LogUtils.d(" loginNum="+loginNum);
if(loginNum>30){
LogUtils.d(" DeleteCreateTables BPA_LOG_RECORD");
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_LOG_RECORD.class,null);
PreferenceUtils.setInt("loginNum",0);
}else {
PreferenceUtils.setInt("loginNum",loginNum+1);
}
}

@Override
@@ -196,5 +209,8 @@ public class MainActivity extends BaseActivity {
startActivityForResult(intent,REQUEST_GOODS_ACTIVITY);
}


@Override
protected String getClassName() {
return "首页";
}
}

+ 201
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/OrderRecordActivity.java View File

@@ -0,0 +1,201 @@
package com.bonait.bnframework.ui.activity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bigkoo.pickerview.TimePickerView;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.util.OrderRecordUtil;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivityOrderBinding;
import com.bonait.bnframework.ui.adapter.OrderAdapter;
import com.bonait.bnframework.ui.dialog.SubOrderDialog;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

public class OrderRecordActivity extends BaseActivity {
private ActivityOrderBinding viewBinding;
/**
* 订单数据
*/
ArrayList<BPA_ORDER_RECORD> orderList = new ArrayList<>();
/**
* 订单管理控制器
*/
private OrderAdapter adapter;
/**
* 日期选择器
*/
TimePickerView pvTime;
/**
* 开始时间-结束时间
*/
private ViewGroup view;
private SubOrderDialog dialog;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
viewBinding = ActivityOrderBinding.inflate(getLayoutInflater());
setContentView(viewBinding.getRoot());
DisplayManager.scaleViewGroup(viewBinding.getRoot());
view=(ViewGroup)getWindow().getDecorView();
initTopBar();
initFragment();
Init();
}

private void initTopBar() {
viewBinding.button.requestFocus();
viewBinding.topbar.setTitle("订单统计");
viewBinding.back.setOnClickListener(v->{
finish();
});
}

/**
* 初始化
*/
private void Init(){
//通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据
viewBinding.starttime.setText(new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date()));
viewBinding.stoptime.setText(new SimpleDateFormat("yyyy-MM-dd 23:59:59").format(new Date()));
viewBinding.starttime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (pvTime != null) {
pvTime.show(viewBinding.starttime);
}
}
});
viewBinding.stoptime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (pvTime != null) {
pvTime.show(viewBinding.stoptime);
}
}
});
viewBinding.button.setOnClickListener(view1 -> Initdata());

adapter = new OrderAdapter() {
@Override
protected void onItemClick(View v, int position) {
if(dialog == null){
dialog = new SubOrderDialog();
}
Bundle bundle = new Bundle();
bundle.putString("goodsId",orderList.get(position).goodsId);
bundle.putString("startTime",startTime);
bundle.putString("stopTime",stopTime);
bundle.putString("desc",desc);
dialog.setArguments(bundle);
dialog.show(getSupportFragmentManager(),"子订单列表弹窗");
}
};
adapter.setNewData(orderList);
viewBinding.recycleView.setAdapter(adapter);
CalendarTime();
Initdata();
}

/**
* CalendarTime
* 时间选择器
*/
public void CalendarTime() {
//控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释)
//因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
Calendar selectedDate = Calendar.getInstance();
Calendar startDate = Calendar.getInstance();
startDate.set(2023, 0, 23);
Calendar endDate = Calendar.getInstance();
endDate.set(2099, 11, 28);
//时间选择器
pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View v) {//选中事件回调
// 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null
TextView btn = (TextView) v;
btn.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));
}
})
//年月日时分秒 的显示与否,不设置则默认全部显示
.setType(new boolean[]{true, true, true, true, true, false})
.setLabel("年", "月", "日", "时", "分", "秒")
.isCenterLabel(true)
.setDividerColor(Color.DKGRAY)
.setContentSize(26)//字号
.setDate(selectedDate)
.setRangDate(startDate, endDate)
.setDecorView(view)
.build();
}

private String startTime = "";
private String stopTime = "";
private String desc = "";
/**
* 初始化数据加载
*/
public void Initdata() {
try {
startTime = viewBinding.starttime.getText().toString();
stopTime = viewBinding.stoptime.getText().toString();
if(DateUtils.compareDate(stopTime,startTime))
{
ToastUtils.warning("开始时间不能大于结束时间!!!");
return;
}

orderList.clear();
desc = viewBinding.edittext.getText().toString();
orderList.addAll(OrderRecordUtil.getAll(startTime,stopTime,viewBinding.edittext.getText().toString()));
adapter.notifyDataSetChanged();

} catch (Exception e) {
e.printStackTrace();
}
}

/**
* viewPager里添加fragment
*/
private void initFragment() {

}
//-------------------------配置viewPager与fragment关联----------------------------//

@Override
public void onDestroy() {
super.onDestroy();
if(orderList!=null){
orderList.clear();
orderList = null;
}
viewBinding.recycleView.setAdapter(null);
if(adapter!=null){
adapter = null;
}
}

@Override
protected boolean canDragBack() {
return false;
}

@Override
protected String getClassName() {
return "订单记录页";
}
}

+ 18
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/RecProcessActivity.java View File

@@ -22,6 +22,7 @@ import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.R;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.business.NewExecuteTheRecipe;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
@@ -220,8 +221,10 @@ public class RecProcessActivity extends BaseActivity {
GoodsProcessDetailDBUtil.removeList(GoodsProcessDetailDBUtil.getByGroupId(subAttributeGroupId));
if(GoodsProcessDetailDBUtil.addList(stepList)){
NewToastUtil.getInstance().showToast("【"+name+"】工序保存成功!");
RecordManager.getInstance().addLogRecord("角色操作日志","录制工序,【"+name+"】工序保存成功!");
}else {
NewToastUtil.getInstance().showToast("【"+name+"】工序保存失败!");
RecordManager.getInstance().addLogRecord("角色操作日志","录制工序,【"+name+"】工序保存失败!");
}
finish();
}
@@ -323,6 +326,10 @@ public class RecProcessActivity extends BaseActivity {
case 4:
switch (value){
case "启动搅拌":
if(isUp){
NewToastUtil.getInstance().showToast("上升状态无法启动搅拌");
return;
}
isStir=true;
viewBinding.device.btnStir.setBackgroundResource(R.drawable.bg_btn_run_anim_looper);
((AnimationDrawable)viewBinding.device.btnStir.getBackground()).start();
@@ -362,6 +369,7 @@ public class RecProcessActivity extends BaseActivity {
handler.removeMessages(MSG_STOP_UPDOWN);
handler.sendEmptyMessageDelayed(MSG_STOP_UPDOWN,time);
isUp=true;
isStir = false;
break;
}
changeDevicePic();
@@ -443,6 +451,7 @@ public class RecProcessActivity extends BaseActivity {
}
Bundle bundle =new Bundle();
bundle.putInt("type",type);
bundle.putStringArrayList("mainFoods",mainFoods);
deviceControlDialog.setArguments(bundle);
deviceControlDialog.setDeviceCallBack(deviceCallBack);
scalePic(1);
@@ -475,6 +484,7 @@ public class RecProcessActivity extends BaseActivity {
*/
@SuppressLint("NotifyDataSetChanged")
public void onRecordStart() {
RecordManager.getInstance().addLogRecord("角色操作日志","录制工序,开始录制");
viewBinding.runtime.setBase(SystemClock.elapsedRealtime() - recordingTime);// 跳过已经记录了的时间,起到继续计时的作用
viewBinding.runtime.start();
viewBinding.textMs.setText("请先{开始}录制");
@@ -496,6 +506,7 @@ public class RecProcessActivity extends BaseActivity {
* 停止计时器
*/
public void onRecordStop() {
RecordManager.getInstance().addLogRecord("角色操作日志","录制工序,停止录制");
viewBinding.runtime.stop();
viewBinding.startGoodmake.SetStatus(false);
IsStart = false;
@@ -541,6 +552,7 @@ public class RecProcessActivity extends BaseActivity {
* 暂停计时器
*/
public void onRecordPause() {
RecordManager.getInstance().addLogRecord("角色操作日志","录制工序,暂停录制");
viewBinding.runtime.stop();
viewBinding.textMs.setText("录制{暂停}中");
recordingTime = SystemClock.elapsedRealtime() - viewBinding.runtime.getBase();// 保存这次记录了的时间
@@ -552,6 +564,7 @@ public class RecProcessActivity extends BaseActivity {
* 继续计时器
*/
public void onRecordPauseStart() {
RecordManager.getInstance().addLogRecord("角色操作日志","录制工序,继续录制");
viewBinding.runtime.setBase(SystemClock.elapsedRealtime() - recordingTime);// 跳过已经记录了的时间,起到继续计时的作用
viewBinding.runtime.start();
viewBinding.textMs.setText("请先{开始}录制");
@@ -581,4 +594,9 @@ public class RecProcessActivity extends BaseActivity {
}
deviceCallBack = null;
}

@Override
protected String getClassName() {
return "录制工序页";
}
}

+ 5
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/SetSeasoningActivity.java View File

@@ -232,4 +232,9 @@ public class SetSeasoningActivity extends BaseActivity {
mHandler = null;
}
}

@Override
protected String getClassName() {
return "料仓设置页";
}
}

+ 5
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/SystemSetActivity.java View File

@@ -133,4 +133,9 @@ public class SystemSetActivity extends BaseActivity {

}
};

@Override
protected String getClassName() {
return "系统设置页";
}
}

+ 59
- 0
app/src/main/java/com/bonait/bnframework/ui/adapter/LocalLogAdapter.java View File

@@ -0,0 +1,59 @@
package com.bonait.bnframework.ui.adapter;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.common.base.BaseAdapter;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemLogBinding;

/**
* @author: liup
* @description: 日志
* @date: 2024/6/3 15:46.
*/
public class LocalLogAdapter extends BaseAdapter<BPA_LOG_RECORD, LocalLogAdapter.ViewHolder> {
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(ItemLogBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}

@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
BPA_LOG_RECORD log = mData.get(position);
if(holder.binding.type.getTextSize()>28||holder.binding.type.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
holder.binding.type.setText(log.typeName+"");
holder.binding.time.setText(log.createTime+"");
if(log.userName!=null){
holder.binding.desc.setText(log.userName+"-"+log.describe+"");
}else {
holder.binding.desc.setText(log.describe+"");
}
}

@Override
protected void onItemClick(View v, int position) {

}

public static class ViewHolder extends RecyclerView.ViewHolder {
private ItemLogBinding binding;


public ViewHolder(ItemLogBinding view) {
super(view.getRoot());
binding = view;
}
}
}


+ 55
- 0
app/src/main/java/com/bonait/bnframework/ui/adapter/OrderAdapter.java View File

@@ -0,0 +1,55 @@
package com.bonait.bnframework.ui.adapter;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.common.base.BaseAdapter;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemOrderBinding;

/**
* @author: liup
* @description: 订单
* @date: 2024/6/3 15:46.
*/
public abstract class OrderAdapter extends BaseAdapter<BPA_ORDER_RECORD, OrderAdapter.ViewHolder> {
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(ItemOrderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}

@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
BPA_ORDER_RECORD order = mData.get(position);//得到当前项选中item实例
if(holder.binding.name.getTextSize()>28||holder.binding.name.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}

holder.binding.name.setText(order.goodsName);
holder.binding.total.setText(order.Count+"");
holder.binding.cancel.setText(order.cancelCount+"");
holder.binding.complete.setText(order.completeCount+"");
holder.binding.error.setText(order.errorCount+"");
holder.binding.root.setOnClickListener(view -> {
onItemClick(view,position);
});
}

public static class ViewHolder extends RecyclerView.ViewHolder {
private ItemOrderBinding binding;


public ViewHolder(ItemOrderBinding view) {
super(view.getRoot());
binding = view;
}
}
}


+ 59
- 0
app/src/main/java/com/bonait/bnframework/ui/adapter/SubOrderAdapter.java View File

@@ -0,0 +1,59 @@
package com.bonait.bnframework.ui.adapter;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.common.base.BaseAdapter;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemOrderBinding;

/**
* @author: liup
* @description: 订单
* @date: 2024/6/3 15:46.
*/
public abstract class SubOrderAdapter extends BaseAdapter<BPA_SUBORDER_RECORD, SubOrderAdapter.ViewHolder> {
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(ItemOrderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}

@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
BPA_SUBORDER_RECORD order = mData.get(position);//得到当前项选中item实例
if(holder.binding.name.getTextSize()>28||holder.binding.name.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
if(order.subNames!=null && !order.subNames.isEmpty()){
holder.binding.name.setText(order.goodsName+"\n"+order.subNames);
}else {
holder.binding.name.setText(order.goodsName+"");
}

holder.binding.total.setText(order.subCount+"");
holder.binding.cancel.setText(order.subCancelCount+"");
holder.binding.complete.setText(order.subCompleteCount+"");
holder.binding.error.setText(order.subErrorCount+"");
holder.binding.root.setOnClickListener(view -> {
onItemClick(view,position);
});
}

public static class ViewHolder extends RecyclerView.ViewHolder {
private ItemOrderBinding binding;


public ViewHolder(ItemOrderBinding view) {
super(view.getRoot());
binding = view;
}
}
}


+ 1
- 2
app/src/main/java/com/bonait/bnframework/ui/adapter/goods/CloudGoodsAdapter.java View File

@@ -13,7 +13,6 @@ import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseAdapter;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.util.GoodsDBUtil;
import com.bonait.bnframework.common.glide.GlideUtil;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
@@ -49,8 +48,8 @@ public abstract class CloudGoodsAdapter extends BaseAdapter<BPA_GOODS,CloudGoods
String url = goods.url;
if(url!=null && !url.isEmpty() &&!url.equals("未知"))
{
GlideUtil.showImage(holder.binding.image.getContext(),url,holder.binding.image,R.mipmap.loading123);
myBitmapUtils.disPlay(holder.binding.image,url);
// GlideUtil.showImage(holder.binding.image.getContext(),url,holder.binding.image,R.mipmap.loading123);
}else {
holder.binding.image.setImageResource(R.mipmap.loading123);
}


+ 4
- 2
app/src/main/java/com/bonait/bnframework/ui/adapter/goods/LocalGoodsAdapter.java View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseAdapter;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.glide.GlideUtil;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemLocalGoodsBinding;

@@ -22,6 +22,7 @@ import com.bonait.bnframework.databinding.ItemLocalGoodsBinding;
*/
public abstract class LocalGoodsAdapter extends BaseAdapter<BPA_GOODS,LocalGoodsAdapter.GoodsViewHolder> {
private boolean isEdit = false;
private MyBitmapUtils myBitmapUtils = new MyBitmapUtils();

public void setEdit(boolean isEdit){
this.isEdit = isEdit;
@@ -62,7 +63,8 @@ public abstract class LocalGoodsAdapter extends BaseAdapter<BPA_GOODS,LocalGoods
String url = goods.url;
if(url!=null && !url.isEmpty() &&!url.equals("未知"))
{
GlideUtil.showImage(holder.binding.image.getContext(),url,holder.binding.image,R.mipmap.loading123);
myBitmapUtils.disPlay(holder.binding.image,url);
// GlideUtil.showImage(holder.binding.image.getContext(),url,holder.binding.image,R.mipmap.loading123);
}else {
holder.binding.image.setImageResource(R.mipmap.loading123);
}


+ 16
- 0
app/src/main/java/com/bonait/bnframework/ui/dialog/DeviceControlDialog.java View File

@@ -24,6 +24,7 @@ import com.bonait.bnframework.R;
import com.bonait.bnframework.Service.AnalogConvert;
import com.bonait.bnframework.Service.ControlAdress;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
@@ -165,12 +166,14 @@ public class DeviceControlDialog extends DialogFragment {
detail.processvalue = "加热档位,"+progressFire+"档|加热控制,启动加热|延迟(秒),0";
detail.processms = "加热("+progressFire+"档,启动加热,0)";
deviceCallBack.onClickEvent(type,"启动加热|"+progressFire,0,detail);
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-启动加热 档位:"+progressFire);
});
//停止加热
viewBinding.layoutFire.btnStopFire.setOnClickListener(view->{
progressFire = 0;
viewBinding.layoutFire.fireProgress.setValue(0,true);
NewToastUtil.getInstance().showToast("停止加热");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-停止加热");
ThreadManager.get().execute(new Thread(() -> ModbusHelper.get().Heating(0,false)));
BPA_GOODS_PROCESS_DETAIL detail = new BPA_GOODS_PROCESS_DETAIL();
detail.processname = "加热";
@@ -219,6 +222,7 @@ public class DeviceControlDialog extends DialogFragment {
String waterValue = viewBinding.layoutSilos.editWater.getText().toString();
if(!waterValue.isEmpty()){
NewToastUtil.getInstance().showToast("开始加水 "+waterValue+"g");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"开始加水 "+waterValue+"g");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addWater(Float.parseFloat(waterValue),false);
}));
@@ -243,6 +247,7 @@ public class DeviceControlDialog extends DialogFragment {
String value = viewBinding.layoutSilos.editQianWater.getText().toString();
if(!value.isEmpty()){
NewToastUtil.getInstance().showToast("开始勾芡 "+value+"g");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"开始勾芡 "+value+"g");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addThickenWater(Float.parseFloat(value), false);
}));
@@ -272,6 +277,7 @@ public class DeviceControlDialog extends DialogFragment {
return;
}
NewToastUtil.getInstance().showToast("添加"+seasoningList.get(seasoningPos)+";"+value2+"g");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"添加"+seasoningList.get(seasoningPos)+";"+value2+"g");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMaterial(Float.parseFloat(value2),(seasoningPos+1),false);
}));
@@ -368,6 +374,7 @@ public class DeviceControlDialog extends DialogFragment {
});
viewBinding.layoutFood.btnFood1.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("倒入主料1号仓");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"倒入主料1号仓");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMainFood((1));
}));
@@ -381,6 +388,7 @@ public class DeviceControlDialog extends DialogFragment {
});
viewBinding.layoutFood.btnFood2.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("倒入主料2号仓");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"倒入主料2号仓");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMainFood((2));
}));
@@ -394,6 +402,7 @@ public class DeviceControlDialog extends DialogFragment {
});
viewBinding.layoutFood.btnFood3.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("倒入主料3号仓");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"倒入主料3号仓");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMainFood((3));
}));
@@ -406,6 +415,7 @@ public class DeviceControlDialog extends DialogFragment {
});
viewBinding.layoutFood.btnFood4.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("倒入主料4号仓");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"倒入主料4号仓");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMainFood((4));
}));
@@ -418,6 +428,7 @@ public class DeviceControlDialog extends DialogFragment {
});
viewBinding.layoutFood.btnFood5.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("倒入主料5号仓");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"倒入主料5号仓");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMainFood((5));
}));
@@ -430,6 +441,7 @@ public class DeviceControlDialog extends DialogFragment {
});
viewBinding.layoutFood.btnFood6.setOnClickListener(v->{
NewToastUtil.getInstance().showToast("倒入主料6号仓");
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"倒入主料6号仓");
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().addMainFood((6));
}));
@@ -482,6 +494,7 @@ public class DeviceControlDialog extends DialogFragment {
return;
}
NewToastUtil.getInstance().showToast("启动搅拌 档位:"+progressStir);
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"启动搅拌 档位:"+progressStir);
ThreadManager.get().execute(new Thread(() -> {
ModbusHelper.get().setStirModel(2);
ModbusHelper.get().setStirTime(1,3);
@@ -497,6 +510,7 @@ public class DeviceControlDialog extends DialogFragment {
detail.materialType = 1;
detail.processvalue = "搅拌档位,"+progressStir+"档|搅拌控制,停止搅拌|正转时间,3|反转时间,3|延迟(秒),0";
detail.processms = "双向搅拌("+0+"档,停止搅拌,3,3,0)";
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"停止搅拌");
viewBinding.layoutStir.stirProgress.setValue(0,true);
NewToastUtil.getInstance().showToast("停止搅拌");
ThreadManager.get().execute(new Thread(() -> ModbusHelper.get().setStirMotor(0,2)));
@@ -510,6 +524,7 @@ public class DeviceControlDialog extends DialogFragment {
detail.materialType = 1;
detail.processvalue = "升降控制,下降|延迟(秒),0";
detail.processms = "升降(下降,0)";
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"下降");
deviceCallBack.onClickEvent(type,"下降",5000,detail);
});
viewBinding.layoutStir.btnStirUp.setOnClickListener(v->{
@@ -538,6 +553,7 @@ public class DeviceControlDialog extends DialogFragment {
detail.materialType = 1;
detail.processvalue = "升降控制,上升|延迟(秒),0";
detail.processms = "升降(上升,0)";
RecordManager.getInstance().addLogRecord("角色操作日志", "手动控制-"+"上升");
deviceCallBack.onClickEvent(type,"上升",5000,detail);
});



+ 67
- 23
app/src/main/java/com/bonait/bnframework/ui/dialog/EditGoodsDialog.java View File

@@ -22,6 +22,7 @@ import androidx.fragment.app.DialogFragment;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.ActivityViewModel.ImageChooseActivity;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.db.mode.BPA_ATTRIBUTE;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
@@ -92,7 +93,6 @@ public class EditGoodsDialog extends DialogFragment {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.DialogScale);

if(getArguments()!=null){
goodId = getArguments().getString("goodId");
isEdit = getArguments().getBoolean("isEdit");
@@ -127,9 +127,10 @@ public class EditGoodsDialog extends DialogFragment {
}
AdbCommandUtil.hideStatusBar(true);
initView();
//首页模式 直接进入页面2 如果没有属性则进入3
if(!isEdit){
if(attributeList.isEmpty()){
subattributeGroup = SubAttributeGroupDBUtil.getById(goodId);
subattributeGroup = SubAttributeGroupDBUtil.getByGoodIdAndListId(goodId,goodId);
changePage(3);
viewBinding.layoutMainfoods.btnLast3.setVisibility(View.INVISIBLE);
}else {
@@ -154,7 +155,7 @@ public class EditGoodsDialog extends DialogFragment {
@SuppressLint("NonConstantResourceId")
@OnClick({R.id.btn_close1, R.id.btn_close2,R.id.btn_close3,
R.id.btn_next1,R.id.btn_next2,R.id.btn_to_cook,R.id.btn_last1,R.id.btn_last3,R.id.btn_edit_process,
R.id.good_image,R.id.btn_last2})
R.id.good_image,R.id.btn_last2,R.id.btn_delete})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.btn_close1:
@@ -202,8 +203,8 @@ public class EditGoodsDialog extends DialogFragment {
if(subattributeGroup!=null){
if(!isEdit){
if(GoodsProcessDetailDBUtil.getByGroupId(subattributeGroup.id).isEmpty()){
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合(没有工序)");
NewToastUtil.getInstance().showToast("该组合没有工序,请前往菜品管理中编辑");
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合\n(没有工序)");
NewToastUtil.getInstance().showToast("该组合没有工序,请先编辑工序");
return;
}
}
@@ -218,7 +219,10 @@ public class EditGoodsDialog extends DialogFragment {
NewToastUtil.getInstance().showToast("数据为空");
}else {
if(GoodsProcessDetailDBUtil.getByGroupId(subattributeGroup.id).isEmpty()){
NewToastUtil.getInstance().showToast("当前组合没有编辑工序,请前往菜品管理编辑");
NewToastUtil.getInstance().showToast(isEdit?
(subattributeGroup.name.isEmpty()?("当前配方没有工序,请先编辑工序"):
("当前组合【"+subattributeGroup.name+"】没有工序,请先编辑工序"))
:"当前组合没有工序,请前往菜品研发编辑工序");
return;
}
jumpToCook();
@@ -244,6 +248,13 @@ public class EditGoodsDialog extends DialogFragment {
startActivity(intent);
}
break;
case R.id.btn_delete:
if(subattributeGroup!=null){
SubAttributeGroupDBUtil.deleteById(subattributeGroup.id);
GoodsProcessDetailDBUtil.deleteByeGroupId(subattributeGroup.id);
}
dismiss();
break;
}
}

@@ -306,7 +317,10 @@ public class EditGoodsDialog extends DialogFragment {
viewBinding.layoutName.getRoot().setVisibility(View.GONE);
viewBinding.layoutAttribute.getRoot().setVisibility(View.GONE);
viewBinding.layoutMainfoods.getRoot().setVisibility(View.VISIBLE);
String name = selectAttributeListAdapter.getSubAttributeNameList();
String name = "";
if(!attributeList.isEmpty()){
name = selectAttributeListAdapter.getSubAttributeNameList();
}
viewBinding.layoutMainfoods.title3.setText(name.isEmpty()?goods.name:(goods.name+"-"+name));
break;
}
@@ -320,15 +334,17 @@ public class EditGoodsDialog extends DialogFragment {
return;
}
if(attributeList.isEmpty()){
subattributeGroup = SubAttributeGroupDBUtil.getById(goodId);
subattributeGroup = SubAttributeGroupDBUtil.getByGoodIdAndListId(goodId,goodId);
if(subattributeGroup==null){
subattributeGroup = new BPA_GOODS_SUBATTRIBUTE_GROUP();
subattributeGroup.goodsId = goods.id;
subattributeGroup.goodsId = goodId;
subattributeGroup.maketime = 0;
subattributeGroup.name = goodId;
subattributeGroup.name = goods.name;
subattributeGroup.subAttributeIdList = goodId;
SubAttributeGroupDBUtil.add(subattributeGroup);
NewToastUtil.getInstance().showToast("创建配方成功,请编辑工序");
RecordManager.getInstance().addLogRecord("角色操作日志", subattributeGroup.name+"-创建配方成功");
}
NewToastUtil.getInstance().showToast("创建配方成功");
return;
}
if(subattributeGroup==null){
@@ -337,17 +353,16 @@ public class EditGoodsDialog extends DialogFragment {
subattributeGroup.maketime = 0;
subattributeGroup.name = "";
subattributeGroup.subAttributeIdList = "";
if(selectAttributeListAdapter != null && selectAttributeListAdapter.datas!=null && !selectAttributeListAdapter.datas.isEmpty()){
subattributeGroup.name = selectAttributeListAdapter.getSubAttributeNameList();
subattributeGroup.subAttributeIdList = selectAttributeListAdapter.getSubAttributeIdList();
}
subattributeGroup.name = selectAttributeListAdapter.getSubAttributeNameList();
subattributeGroup.subAttributeIdList = selectAttributeListAdapter.getSubAttributeIdList();
SubAttributeGroupDBUtil.add(subattributeGroup);
groupList.add(subattributeGroup.name);
viewBinding.layoutAttribute.spinnerList.setSelection(groupList.size()-1);
NewToastUtil.getInstance().showToast("创建组合【"+subattributeGroup.name+"】成功");
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合\n(没有工序)");
RecordManager.getInstance().addLogRecord("角色操作日志", subattributeGroup.name+"-创建配方成功");
}else {
if(selectAttributeListAdapter != null && selectAttributeListAdapter.datas!=null && !selectAttributeListAdapter.datas.isEmpty()){
subattributeGroup.name = selectAttributeListAdapter.getSubAttributeNameList();
// subattributeGroup.subAttributeIdList = selectAttributeListAdapter.getSubAttributeIdList();
}
subattributeGroup.name = selectAttributeListAdapter.getSubAttributeNameList();//修改名称顺序
SubAttributeGroupDBUtil.update(subattributeGroup);
}
}
@@ -486,7 +501,9 @@ public class EditGoodsDialog extends DialogFragment {
viewBinding.layoutMainfoods.editName6.setEnabled(false);
viewBinding.layoutMainfoods.editName6.setFocusable(false);
viewBinding.layoutMainfoods.editName6.setFocusableInTouchMode(false);
viewBinding.layoutMainfoods.btnEditProcess.setVisibility(View.GONE);
viewBinding.layoutMainfoods.llEdit.setVisibility(View.GONE);
}else {
viewBinding.layoutMainfoods.llEdit.setVisibility(View.VISIBLE);
}
}

@@ -503,7 +520,7 @@ public class EditGoodsDialog extends DialogFragment {
if(!hasGroup().isEmpty()){
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合");
if(GoodsProcessDetailDBUtil.getByGroupId(subattributeGroup.id).isEmpty()){
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合(没有工序)");
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合\n(没有工序)");
}
viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_yellow_btn);
int pos = 0;
@@ -545,12 +562,31 @@ public class EditGoodsDialog extends DialogFragment {
private boolean isUserClicked = false;
private void groupSpinnerView(){
groupList.clear();
groupList.add("未匹配");
if(attributeList==null || attributeList.isEmpty()){
return;
}
for (BPA_GOODS_SUBATTRIBUTE_GROUP group : SubAttributeGroupDBUtil.getByGoodsId(goodId)){
if(group.name!=null&&!group.name.isEmpty()){
groupList.add(group.name);
}
}
List<String> update = new ArrayList<>(groupList);
//过滤掉父属性数量不匹配的数据
for(String name :groupList){
if(name.contains("-")){
String[] res = name.split("-");
if(res.length != attributeList.size()){
update.remove(name);
}
}else {
if(attributeList.size()!=1){
update.remove(name);
}
}
}
groupList.clear();
groupList.add("未匹配");
groupList.addAll(update);
int pos = 0;
// for(int i =0;i<groupList.size();i++){
// if(groupList.get(i).equals(selectAttributeListAdapter.getSubAttributeNameList())){
@@ -590,7 +626,7 @@ public class EditGoodsDialog extends DialogFragment {
public void run() {
hasGroup();
if(GoodsProcessDetailDBUtil.getByGroupId(subattributeGroup.id).isEmpty()){
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合(没有工序)");
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合\n(没有工序)");
}
}
},300);
@@ -603,6 +639,11 @@ public class EditGoodsDialog extends DialogFragment {
public void onNothingSelected(AdapterView<?> adapterView) {
}
});

if(groupList.size()>1){
isUserClicked = true;
viewBinding.layoutAttribute.spinnerList.setSelection(1);
}
}

/**
@@ -611,6 +652,9 @@ public class EditGoodsDialog extends DialogFragment {
*/
public void updateImage(String url){
picUrl = url;
if(picUrl == null){
picUrl= "";
}
LogUtils.d(TAG+" updateCircleImage url="+url);
if(picUrl.isEmpty()){
viewBinding.layoutName.goodImage.setImageResource(R.mipmap.loading123);


+ 97
- 0
app/src/main/java/com/bonait/bnframework/ui/dialog/SubOrderDialog.java View File

@@ -0,0 +1,97 @@
package com.bonait.bnframework.ui.dialog;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;
import com.bonait.bnframework.common.db.util.SubOrderRecordUtil;
import com.bonait.bnframework.common.utils.AdbCommandUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogSubOrderBinding;
import com.bonait.bnframework.ui.adapter.SubOrderAdapter;

import java.util.ArrayList;

/**
* @author: liup
* @description:
* @date: 2024/6/3 17:59.
*/
public class SubOrderDialog extends DialogFragment {
private String TAG = " SubOrderDialog =>";
private DialogSubOrderBinding viewBinding;
private String goodsId;
private String startTime;
private String stopTime;
private String desc;
/**
* 子订单数据
*/
ArrayList<BPA_SUBORDER_RECORD> orderList = new ArrayList<>();

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.DialogScale);
if (getArguments() != null) {
goodsId = getArguments().getString("goodsId");
startTime = getArguments().getString("startTime");
stopTime = getArguments().getString("stopTime");
desc = getArguments().getString("desc");
LogUtils.d(TAG + ";goodsId="+goodsId+";startTime="+startTime+";stopTime="+stopTime);
}
orderList = SubOrderRecordUtil.getByGoodsId(goodsId,startTime,stopTime,desc);
}

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
viewBinding = DialogSubOrderBinding.inflate(inflater, container, false);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
return viewBinding.getRoot();
}

@Override
public void onStart() {
super.onStart();
if (getDialog() != null) {
Window window = getDialog().getWindow();
assert window != null;
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.CENTER;
params.width = ViewGroup.LayoutParams.WRAP_CONTENT;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
window.setAttributes(params);
}
AdbCommandUtil.hideStatusBar(true);
initView();

}

private void initView(){
viewBinding.btnClose.setOnClickListener(v->{
dismiss();
});
SubOrderAdapter adapter = new SubOrderAdapter() {
@Override
protected void onItemClick(View v, int position) {
}
};
adapter.setNewData(orderList);
viewBinding.recycleView.setAdapter(adapter);
}
}

+ 5
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/HomeDevicesFragment.java View File

@@ -201,6 +201,10 @@ public class HomeDevicesFragment extends BaseFragment {
case 4:
switch (value){
case "启动搅拌":
if(isUp){
NewToastUtil.getInstance().showToast("上升状态无法启动搅拌");
return;
}
isStir=true;
viewBinding.device.btnStir.setBackgroundResource(R.drawable.bg_btn_run_anim_looper);
((AnimationDrawable)viewBinding.device.btnStir.getBackground()).start();
@@ -241,6 +245,7 @@ public class HomeDevicesFragment extends BaseFragment {
handler.removeMessages(MSG_STOP_UPDOWN);
handler.sendEmptyMessageDelayed(MSG_STOP_UPDOWN,time);
isUp=true;
isStir = false;
break;
}
changeDevicePic();


+ 10
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/HomeMainFragment.java View File

@@ -14,6 +14,7 @@ import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.ActivityViewModel.LoginActivity;
import com.bonait.bnframework.ViewModel.CustomView.XComDialog;
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.utils.AlertDialogUtils;
@@ -22,7 +23,9 @@ import com.bonait.bnframework.databinding.DialogWithCancelConfirmBinding;
import com.bonait.bnframework.databinding.FragmentHomeMainBinding;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.ui.activity.ErrorInfoActivity;
import com.bonait.bnframework.ui.activity.LogRecordActivity;
import com.bonait.bnframework.ui.activity.MainActivity;
import com.bonait.bnframework.ui.activity.OrderRecordActivity;
import com.bonait.bnframework.ui.activity.SetSeasoningActivity;
import com.bonait.bnframework.ui.widget.NewToastUtil;
import com.orhanobut.logger.Logger;
@@ -89,6 +92,12 @@ public class HomeMainFragment extends BaseFragment {
binding.llError.setOnClickListener(v->{
OpenActivity(ErrorInfoActivity.class);
});
binding.llLog.setOnClickListener(v->{
OpenActivity(LogRecordActivity.class);
});
binding.llOrder.setOnClickListener(v->{
OpenActivity(OrderRecordActivity.class);
});
binding.logout.setOnClickListener(v->{
String title = "温馨提示!";
String message = "客官确定要退出程序吗,小菠萝会想你的哦?";
@@ -109,6 +118,7 @@ public class HomeMainFragment extends BaseFragment {
@Override
public void onClick(View view) {
skipToLoginActivity();
RecordManager.getInstance().addLogRecord("角色操作日志",ConfigName.getInstance().user.name+"-退出登录");
xCom.dismissX();
}
});


+ 5
- 3
app/src/main/java/com/bonait/bnframework/ui/fragment/goods/CloudGoodsFragment.java View File

@@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.Model.GoodsClassifyBean;
import com.bonait.bnframework.R;
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;
@@ -25,7 +26,6 @@ import com.bonait.bnframework.common.db.util.GoodsDBUtil;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DimensUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.FragmentCloudGoodsBinding;
import com.bonait.bnframework.event.FreshLocalGoodsEvent;
import com.bonait.bnframework.ui.adapter.classify.ClassifyAdapter;
@@ -123,6 +123,7 @@ public class CloudGoodsFragment extends BaseFragment {
AlertDialogUtils.showTipDialog((AppCompatActivity) getActivity(), "数据同步", "下载云端所有菜品到本地,拥有相同的分类将会被覆盖,请确认?", new AlertDialogUtils.DialogClickListener() {
@Override
public void onConfirm() {
RecordManager.getInstance().addLogRecord("角色操作日志", "数据同步");
if(progressDialog ==null){
progressDialog = new WaiteProgressDialog(getContext());
}else {
@@ -157,7 +158,7 @@ public class CloudGoodsFragment extends BaseFragment {
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
outRect.top = DimensUtil.getDimens(0);
outRect.bottom = DimensUtil.getDimens(15);
outRect.bottom = (int) (DisplayManager.getWidthScaleRate()*(-60));
}
});
viewBinding.recyclerGoods.setAdapter(goodsAdapter);
@@ -252,7 +253,7 @@ public class CloudGoodsFragment extends BaseFragment {
BPA_GOODS goods = goodsAdapter.getData().get(pos);
BPA_GOODS_CLASSIFY goodsClassify = classifyAdapter.getData().get(classifyAdapter.getCurrentPosition());
if(GoodsDBUtil.getByIdAndClassifyId(goods.id,goodsClassify.id)!=null){
ToastUtils.warning("请勿重复下载,本地商品已存在!!!");
NewToastUtil.getInstance().showToastError("请勿重复下载,本地商品已存在!!!");
return false;
}else {
viewModel.downLoadCloudGoods(goods,goodsClassify);
@@ -265,6 +266,7 @@ public class CloudGoodsFragment extends BaseFragment {
public void onGoodsChangeEvent(FreshLocalGoodsEvent event){
if(progressDialog!=null){
progressDialog.dismiss();
RecordManager.getInstance().addLogRecord("角色操作日志", "数据同步成功");
}
updateData();
}


+ 8
- 4
app/src/main/java/com/bonait/bnframework/ui/fragment/goods/LocalGoodsFragment.java View File

@@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.business.MainInit;
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;
@@ -29,7 +30,6 @@ import com.bonait.bnframework.common.db.util.SubAttributeGroupDBUtil;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DimensUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.DialogDeleteClassifyBinding;
import com.bonait.bnframework.databinding.FragmentLocalGoodsBinding;
import com.bonait.bnframework.event.FreshLocalGoodPicEvent;
@@ -121,6 +121,7 @@ public class LocalGoodsFragment extends BaseFragment {
public void onConfirm() {
MainInit.clearGoodsInfo();
updateData();
RecordManager.getInstance().addLogRecord("角色操作日志","删除所有商品信息");
}

@Override
@@ -145,6 +146,7 @@ public class LocalGoodsFragment extends BaseFragment {
if(getActivity()!=null){
editGoodsDialog.show(getActivity().getSupportFragmentManager(),"editGoods");
}
RecordManager.getInstance().addLogRecord("角色操作日志","点击["+mData.get(position).name+"]菜品");
}
}

@@ -167,12 +169,13 @@ public class LocalGoodsFragment extends BaseFragment {
GoodsProcessDetailDBUtil.deleteByGoodsId(bean.id);
SubAttributeGroupDBUtil.deleteByGoodsId(bean.id);
if(GoodsDBUtil.delete(bean)){
ToastUtils.info("删除["+bean.name+"]成功!");
NewToastUtil.getInstance().showToast("删除["+bean.name+"]成功!");
goodsList.remove(bean);
goodsAdapter.notifyDataSetChanged();
xCom.dismissX();
RecordManager.getInstance().addLogRecord("角色操作日志","删除["+bean.name+"]菜品成功!");
}else {
ToastUtils.info("删除["+bean.name+"]失败!");
NewToastUtil.getInstance().showToast("删除["+bean.name+"]失败!");
}
});
});
@@ -189,7 +192,7 @@ public class LocalGoodsFragment extends BaseFragment {
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
outRect.top = DimensUtil.getDimens(0);
outRect.bottom = DimensUtil.getDimens(15);
outRect.bottom = (int) (DisplayManager.getWidthScaleRate()*(-60));
}
});
viewBinding.recyclerGoods.setAdapter(goodsAdapter);
@@ -198,6 +201,7 @@ public class LocalGoodsFragment extends BaseFragment {
@Override
protected void onItemClick(View v, int position) {
LogUtils.d("分类列表点击 position="+position+" name = "+mData.get(position).name);
RecordManager.getInstance().addLogRecord("角色操作日志","点击["+mData.get(position).name+"]分类");
handler.removeMessages(MSG_FRESH_GOODS);
handler.sendEmptyMessageDelayed(MSG_FRESH_GOODS,FRESH_DELAY_TIME);//避免快速点击
}


+ 82
- 7
app/src/main/java/com/bonait/bnframework/ui/fragment/silos/MaterialFragment.java View File

@@ -2,6 +2,9 @@ package com.bonait.bnframework.ui.fragment.silos;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
@@ -11,18 +14,27 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.fastjson.TypeReference;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.HBL.API.APIHelper;
import com.bonait.bnframework.HBL.API.APIResultT;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.Model.MaterialData;
import com.bonait.bnframework.Model.MaterialRequestPar;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.CustomView.XComDialog;
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.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.util.MaterialUtil;
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.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.FragmentMaterialBinding;
import com.bonait.bnframework.ui.adapter.silos.MaterialAdapter;
import com.bonait.bnframework.ui.widget.NewToastUtil;

import java.util.ArrayList;
import java.util.List;
@@ -37,6 +49,12 @@ public class MaterialFragment extends BaseFragment {
private Context context;
private List<BPA_MATERIAL> dataList = new ArrayList<>();
private MaterialAdapter adapter;
private Handler handler = new Handler(Looper.getMainLooper()){
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
}
};

@Override
protected View onCreateView() {
@@ -62,11 +80,11 @@ public class MaterialFragment extends BaseFragment {
public void onClick(View view) {
String name = viewBinding.edit.getText().toString();
if (name.isEmpty()) {
ToastUtils.info("物料名称不能为空");
NewToastUtil.getInstance().showToast("物料名称不能为空");
return;
}
if (QueryDB.GetMaterialIs(name)) {
ToastUtils.info("物料名称重复,请重新输入后重试!");
NewToastUtil.getInstance().showToast("物料名称重复,请重新输入后重试!");
return;
}
BPA_MATERIAL bpa_material = new BPA_MATERIAL();
@@ -76,10 +94,62 @@ public class MaterialFragment extends BaseFragment {
bpa_material.deviceID = ConfigName.getInstance().DeviceId;
bpa_material.userID = ConfigName.getInstance().user.userID;
QueryDB.AddMaterial(bpa_material);
ToastUtils.info("新增成功");
NewToastUtil.getInstance().showToast("新增成功");
RecordManager.getInstance().addLogRecord("角色操作日志","新增["+name+"]物料成功");
updateData();
}
});
viewBinding.btnSynchronous.setOnClickListener(v->{
ThreadManager.get().execute(new Thread(this::GetMaterialInfo));
});
}

private void GetMaterialInfo(){
String url = "https://cfv.black-pa.com/saasbase/api/ExternalPlatform/Material/GetMaterialPageList";
LogUtils.d("GetMaterialInfo url="+url);
String key ="2c39bc05-25c2-46c4-b5c6-dba349058492";
RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息-"+url);
APIHelper.PostT(url,new MaterialRequestPar(1,100),key,new TypeReference<APIResultT<MaterialData>>(){}).OnSource(s->{
RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息成功");
UpdateLocalMaterial(s.Content);
});
}

private void UpdateLocalMaterial(MaterialData materialModels){
List<BPA_MATERIAL> datas = new ArrayList<>();
ArrayList<BPA_MATERIAL> materials = MaterialUtil.GetMaterialALL();
for(int i = 0;i<materialModels.data.size();i++){
if(materialModels.data.get(i).name!=null){
boolean isExit = false;
for(BPA_MATERIAL bean : materials){
if (bean.name.equals(materialModels.data.get(i).name)) {
isExit = true;
break;
}
}
if(!isExit){
BPA_MATERIAL bpa_material =new BPA_MATERIAL();
bpa_material.name = materialModels.data.get(i).name;
bpa_material.id = materialModels.data.get(i).id;
datas.add(bpa_material);
}
}
}
LogUtils.d("UpdateLocalMaterial datas.size="+datas);
if(!datas.isEmpty()){
MaterialUtil.addMaterialList(BPA_MATERIAL.class,datas);
NewToastUtil.getInstance().showToast("已同步云端物料信息");
if(handler!=null){
handler.post(new Runnable() {
@Override
public void run() {
updateData();
}
});
}
}else {
NewToastUtil.getInstance().showToast("已是最新数据");
}
}

/**
@@ -125,15 +195,16 @@ public class MaterialFragment extends BaseFragment {
CharSequence text = editName.getText();
if (text != null && text.length() > 0) {
if (QueryDB.GetMaterialIs(text.toString())) {
ToastUtils.info("物料名称重复,请重新输入后重试!");
NewToastUtil.getInstance().showToast("物料名称重复,请重新输入后重试!");
return;
}
QueryDB.UpdateMaterialName(((BPA_MATERIAL) data).id, text.toString());
updateData();
RecordManager.getInstance().addLogRecord("角色操作日志","修改["+text.toString()+"]物料成功");
xCom.dismissX();
} else {
//请填入昵称
ToastUtils.info("物料名称不能为空!");
NewToastUtil.getInstance().showToast("物料名称不能为空!");
}
}
});
@@ -142,6 +213,7 @@ public class MaterialFragment extends BaseFragment {
break;
case R.id.btn_delete://删除按钮
QueryDB.DeleteMaterial((BPA_MATERIAL) data);
RecordManager.getInstance().addLogRecord("角色操作日志","删除["+((BPA_MATERIAL) data).name+"]物料成功");
updateData();
break;
}
@@ -160,6 +232,9 @@ public class MaterialFragment extends BaseFragment {
adapter = null;
dataList.clear();
dataList = null;

if(handler!=null){
handler.removeCallbacksAndMessages(null);
handler = null;
}
}
}

+ 5
- 2
app/src/main/java/com/bonait/bnframework/ui/fragment/silos/SilosFragment.java View File

@@ -17,6 +17,7 @@ import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.R;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.ViewModel.CustomView.XComDialog;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.db.QueryDB;
@@ -111,7 +112,6 @@ public class SilosFragment extends BaseFragment {
.addItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL();
BPA_MATERIAL material = materials.get(which);
item.silosID = lc.id;
@@ -120,6 +120,7 @@ public class SilosFragment extends BaseFragment {
if (QueryDB.UpdateSilosAndMaterial(item)) {
updateData();
dialog.dismiss();
RecordManager.getInstance().addLogRecord("角色操作日志","["+material.name+"]绑定");
}
}
})
@@ -186,7 +187,7 @@ public class SilosFragment extends BaseFragment {
}else {
NewToastUtil.getInstance().showToastError("保存失败");
}
RecordManager.getInstance().addLogRecord("角色操作日志","保存["+((BPA_SILOS_CALIBRATE) bean).name+"]校准成功");
}
});

@@ -198,6 +199,7 @@ public class SilosFragment extends BaseFragment {
return;
}
startCalibration(Float.parseFloat(editOutMax.getText().toString()),position+1,true);
RecordManager.getInstance().addLogRecord("角色操作日志","["+bean.name+"]最大时间校准");
}
});
tvMinCalibration.setOnClickListener(new View.OnClickListener() {
@@ -208,6 +210,7 @@ public class SilosFragment extends BaseFragment {
return;
}
startCalibration(Float.parseFloat(editOutMin.getText().toString()),position+1,true);
RecordManager.getInstance().addLogRecord("角色操作日志","["+bean.name+"]最小时间校准");
}
});
}


+ 15
- 11
app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java View File

@@ -16,6 +16,7 @@ import com.bonait.bnframework.Model.GoodsClassifyBean;
import com.bonait.bnframework.Model.MaterialData;
import com.bonait.bnframework.Model.MaterialRequestPar;
import com.bonait.bnframework.Model.ProcessValueUtil;
import com.bonait.bnframework.business.RecordManager;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_ATTRIBUTE;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
@@ -85,8 +86,10 @@ public class HomeGoodsViewModel extends ViewModel {
String autoKey = ConfigName.getInstance().DeviceAutoKey;
String url = "https://cfv.black-pa.com/kitchbase/api/goods/Getdevicegoods?deviceId=257";
LogUtils.d("GetGoodsInfo url="+url);
RecordManager.getInstance().addLogRecord("数据接收", "请求商品信息-"+url);
APIHelper.PostT(url,null,null,new TypeReference<APIResultT<List<GoodsClassifyBean>>>(){}).OnSource(s->{
LogUtils.d("GetGoodsInfo s.Content="+s.Content);
RecordManager.getInstance().addLogRecord("数据接收", "接收商品信息成功");
runOnUiThread(new Runnable() {
@Override
public void run() {
@@ -104,7 +107,9 @@ public class HomeGoodsViewModel extends ViewModel {
long curTime5 = System.currentTimeMillis();
LogUtils.d(" GetMaterialInfo1 usetime="+(curTime5-lastTime));
lastTime = curTime5;
RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息-"+url);
APIHelper.PostT(url,new MaterialRequestPar(1,100),key,new TypeReference<APIResultT<MaterialData>>(){}).OnSource(s->{
RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息成功");
UpdateLocalMaterial(s.Content);
});
long curTime6 = System.currentTimeMillis();
@@ -141,6 +146,7 @@ public class HomeGoodsViewModel extends ViewModel {


public void downLoadCloudGoods(BPA_GOODS goods, BPA_GOODS_CLASSIFY goodsClassify){
RecordManager.getInstance().addLogRecord("角色操作日志",goods.name+"-下载");
long curTime6 = System.currentTimeMillis();
LogUtils.d(" downLoadCloudGoods usetime="+(curTime6-lastTime));
lastTime = curTime6;
@@ -211,7 +217,6 @@ public class HomeGoodsViewModel extends ViewModel {
List<String> groupList = new ArrayList<>();
for (GoodsClassifyBean.GoodsInfoListBean.GoodsTechnologyActionListBean goodsTechnologyActionListBean:goodsInfoListBean.getGoodsTechnologyActionList()){
//添加子属性组合
//TODO 需确定getGoodsAttributeId 是用id列表还是name组合 app上新增的id和云端的肯定不匹配 建议用name组合
if(!groupList.contains(goodsTechnologyActionListBean.getGoodsAttributeId())){
BPA_GOODS_SUBATTRIBUTE_GROUP group = new BPA_GOODS_SUBATTRIBUTE_GROUP();
group.id = goodsTechnologyActionListBean.getGoodsAttributeId()==null?"xxxxx123":goodsTechnologyActionListBean.getGoodsAttributeId();
@@ -226,7 +231,8 @@ public class HomeGoodsViewModel extends ViewModel {
processDetail.goodsSubAttributeGroupId = goodsTechnologyActionListBean.getGoodsAttributeId()==null?"xxxxx123":goodsTechnologyActionListBean.getGoodsAttributeId();
processDetail.materialType = goodsTechnologyActionListBean.getStepName().contains("液体")?0:1;
String value = ProcessValueUtil.dealProcessJsonToValue(goodsTechnologyActionListBean.getActionJson());
processDetail.processms = "";
processDetail.processms = goodsTechnologyActionListBean.getStepName()+ProcessValueUtil.dealProcessSms(value);
processDetail.sort = goodsTechnologyActionListBean.getSort();
processDetail.processname = goodsTechnologyActionListBean.getStepName();
processDetail.processvalue = value;
GoodsProcessDetailDBUtil.add(processDetail);
@@ -241,6 +247,7 @@ public class HomeGoodsViewModel extends ViewModel {
long curTime7 = System.currentTimeMillis();
LogUtils.d(" downLoadCloudGoods2 usetime="+(curTime7-lastTime));
lastTime = curTime7;
RecordManager.getInstance().addLogRecord("角色操作日志",goods.name+"-下载成功");
}

private long lastTime = System.currentTimeMillis();
@@ -398,7 +405,6 @@ public class HomeGoodsViewModel extends ViewModel {
item.getGoodsInfoList().forEach(goodinfo->{
try {
List<String> groupList = new ArrayList<>();
int pos1 = 0;
for (GoodsClassifyBean.GoodsInfoListBean.GoodsTechnologyActionListBean goodsTechnologyActionListBean:
goodinfo.getGoodsTechnologyActionList()){
//添加子属性组合
@@ -416,9 +422,9 @@ public class HomeGoodsViewModel extends ViewModel {
processDetail.goodsSubAttributeGroupId = goodsTechnologyActionListBean.getGoodsAttributeId()==null?"xxxxx123":goodsTechnologyActionListBean.getGoodsAttributeId();
processDetail.materialType = goodsTechnologyActionListBean.getStepName().contains("液体")?0:1;
String value = ProcessValueUtil.dealProcessJsonToValue(goodsTechnologyActionListBean.getActionJson());
processDetail.processms = ProcessValueUtil.dealProcessSms(value);
pos1++;
processDetail.sort = pos1;
processDetail.processms = goodsTechnologyActionListBean.getStepName()+ProcessValueUtil.dealProcessSms(value);
processDetail.sort = goodsTechnologyActionListBean.getSort();
LogUtils.d(" goodsTechnologyActionListBean.getSort()="+goodsTechnologyActionListBean.getSort()+" processDetail.sort="+processDetail.sort);
processDetail.processname = goodsTechnologyActionListBean.getStepName();
processDetail.processvalue = value;
datas1.add(processDetail);
@@ -443,10 +449,9 @@ public class HomeGoodsViewModel extends ViewModel {
String[] props = goodsAttributeId.split("[,]");
StringBuffer recpipeNameTemp = new StringBuffer();
try{
for(int i=0;i<props.length;i++){
String id = props[i];
for(GoodsClassifyBean.GoodsAttributeListBean bean : attributes){
for(GoodsClassifyBean.GoodsAttributeListBean.GoodsAttributeValueListBean sub:bean.getGoodsAttributeValueList()){
for(GoodsClassifyBean.GoodsAttributeListBean bean : attributes){
for(GoodsClassifyBean.GoodsAttributeListBean.GoodsAttributeValueListBean sub:bean.getGoodsAttributeValueList()){
for(String id : props){
if(sub!=null && sub.getGoodsAttributeValueId().equals(id)){
recpipeNameTemp.append(sub.getAttributeValue()).append("-");
}
@@ -459,7 +464,6 @@ public class HomeGoodsViewModel extends ViewModel {
if(recpipeNameTemp.toString().isEmpty()){
return "";
}

return recpipeNameTemp.toString().substring(0, recpipeNameTemp.length() - 1);
}



+ 18
- 0
app/src/main/res/drawable/bg_bottom_line.xml View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- 在Topbar下方的Tab面板的背景,带底部分割线 -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
>
<item
android:left="-10dp"
android:right="-10dp"
android:top="-10dp">
<shape>
<!-- <solid android:color="@color/tab_panel_bg" />-->
<stroke
android:width="1dp"
android:color="@color/color3" />
</shape>
</item>

</layer-list>

+ 17
- 0
app/src/main/res/drawable/bg_round25_red_btn.xml View File

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

<item android:state_pressed="true">
<shape>
<corners android:radius="@dimen/dp_25"/>
<solid android:color="#FF9800"/>
</shape>

</item>
<item>
<shape>
<corners android:radius="@dimen/dp_25"/>
<solid android:color="#DA5A17"/>
</shape>
</item>
</selector>

+ 2
- 1
app/src/main/res/layout/activity_cook.xml View File

@@ -115,11 +115,12 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:drawablePadding="@dimen/dp_5"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
/>
</com.qmuiteam.qmui.widget.QMUITopBarLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 2
- 1
app/src/main/res/layout/activity_edit_classify.xml View File

@@ -253,7 +253,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 2
- 1
app/src/main/res/layout/activity_edit_process.xml View File

@@ -265,7 +265,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 2
- 1
app/src/main/res/layout/activity_error_info.xml View File

@@ -19,7 +19,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 215
- 0
app/src/main/res/layout/activity_log.xml View File

@@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white"
android:id="@+id/root"
android:fitsSystemWindows="true">



<RelativeLayout
android:id="@+id/tabs"
android:layout_marginTop="54dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/ll_time"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_5"
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
android:text="时间范围:"
/>
<TextView
android:id="@+id/starttime"
android:layout_width="@dimen/dp_200"
android:layout_height="match_parent"
android:padding="3dp"
android:textColor="@color/foreground"
android:background="@drawable/input_bj"
android:layout_marginLeft="@dimen/dp_5"
tools:text="2023-02-33 00:00:00"
android:gravity="center"
android:textSize="@dimen/sp_26"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
android:text="——"/>
<EditText
android:id="@+id/stoptime"
android:layout_width="@dimen/dp_200"
android:layout_height="match_parent"
android:focusable="false"
android:textColor="@color/foreground"
android:background="@drawable/input_bj"
android:layout_marginLeft="@dimen/dp_5"
android:text="2023-02-33 00:00:00"
android:gravity="center"
android:textSize="@dimen/sp_26"/>
</LinearLayout>

<LinearLayout
android:layout_below="@id/ll_time"
android:id="@+id/ll_type"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/dp_10"
android:layout_height="90dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_5"
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
android:text="日志类型:"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="@dimen/dp_200"
android:layout_height="match_parent"
style="@style/commonSpinnerStyle"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
android:visibility="invisible"
android:text="——"/>
<EditText
android:id="@+id/edittext"
android:layout_width="@dimen/dp_200"
android:layout_height="match_parent"
android:inputType="text"
android:padding="3dp"
android:textColor="@color/foreground"
android:background="@drawable/input_bj"
android:hint="请输入查询条件"
android:maxLines="1"
android:textSize="@dimen/sp_26"/>

</LinearLayout>

<LinearLayout
android:layout_below="@id/ll_type"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:background="@color/color3"
android:orientation="horizontal"
android:layout_height="@dimen/dp_50">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="日志类型"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2.5">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="日志时间"
android:textStyle="bold"
android:textColor="@color/white"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="日志描述"
android:textStyle="bold"
android:textColor="@color/white"/>
</RelativeLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
/>
</LinearLayout>


<Button
android:id="@+id/btn_query"
android:text="查 询"
android:background="@drawable/bg_btn_login_selected"
android:textSize="@dimen/sp_32"
android:layout_marginLeft="@dimen/dp_10"
android:layout_gravity="center"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_180"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/white"
android:focusableInTouchMode="true"
android:focusable="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_10"
>
<requestFocus/>
</Button>
</RelativeLayout>

<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:drawablePadding="@dimen/dp_5"
/>
</com.qmuiteam.qmui.widget.QMUITopBarLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 229
- 0
app/src/main/res/layout/activity_order.xml View File

@@ -0,0 +1,229 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white"
android:id="@+id/root"
android:fitsSystemWindows="true">

<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:drawableLeft="@mipmap/fanhui"
android:drawablePadding="@dimen/dp_5"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_50"
android:text=" 返 回"
android:textColor="@color/white"
android:textSize="@dimen/sp_32" />
</com.qmuiteam.qmui.widget.QMUITopBarLayout>

<RelativeLayout
android:id="@+id/tabs"
android:layout_marginTop="?attr/qmui_topbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:layout_alignParentBottom="true">

<TextView
android:id="@+id/starttime"
android:layout_width="@dimen/dp_200"
android:layout_height="match_parent"
android:padding="3dp"
android:textColor="@color/foreground"
android:background="@drawable/input_bj"
android:layout_marginLeft="@dimen/dp_5"
tools:text="2023-02-33 00:00:00"
android:gravity="center"
android:textSize="@dimen/sp_26"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
android:text="——">
</TextView>
<TextView
android:id="@+id/stoptime"
android:layout_width="@dimen/dp_200"
android:layout_height="match_parent"
android:focusable="false"
android:textColor="@color/foreground"
android:background="@drawable/input_bj"
android:layout_marginLeft="@dimen/dp_5"
android:text="2023-02-33 00:00:00"
android:gravity="center"
android:textSize="@dimen/sp_26"/>

<EditText
android:id="@+id/edittext"
android:layout_width="@dimen/dp_180"
android:layout_height="match_parent"
android:inputType="text"
android:padding="3dp"
android:textColor="@color/foreground"
android:background="@drawable/input_bj"
android:layout_marginLeft="10dp"
android:hint="请输入查询条件"
android:maxLines="1"
android:textSize="@dimen/sp_26"/>

<Button
android:id="@+id/button"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="15dp"
android:background="@drawable/bg_btn_login_selected"
android:text="查 询"
android:textColor="@color/white"
android:focusable="true"
android:focusableInTouchMode="true"
android:textSize="@dimen/sp_24" >
<requestFocus/>
</Button>
</LinearLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" (温馨提示,点击行可查看详情)"
android:textSize="@dimen/sp_20"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/red_primary"
/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="vertical">

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@color/color3"
android:layout_height="@dimen/dp_50">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="商品名称"
android:textAlignment="center"
android:textStyle="bold"
android:textSize="@dimen/sp_26"
android:gravity="center"
android:textColor="@color/white"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:layout_alignParentLeft="true"
android:text="订单总量"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:text="已制作"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:text="取消订单"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>


<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:text="异常订单"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>
</LinearLayout>


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

</RelativeLayout>

</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 2
- 1
app/src/main/res/layout/activity_rec_process.xml View File

@@ -17,7 +17,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 58
- 60
app/src/main/res/layout/activity_seasoning_set.xml View File

@@ -9,75 +9,72 @@
android:id="@+id/root"
android:fitsSystemWindows="true">

<Button
android:id="@+id/btn_synchronous"
android:layout_width="@dimen/dp_175"
android:layout_height="@dimen/dp_70"
android:layout_marginTop="@dimen/dp_64"
app:layout_constraintLeft_toRightOf="@id/btn_add"
app:layout_constraintTop_toTopOf="@id/title"
android:layout_marginLeft="@dimen/dp_25"
android:textSize="@dimen/sp_32"
android:textColor="@color/white"
android:text="同步云端"
android:visibility="gone"
android:background="@drawable/bg_round15_yellow_btn"
/>
<TextView
android:layout_width="1dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_height="1dp">
<requestFocus/>
</TextView>

<LinearLayout
android:id="@+id/ll_tab"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_70"
tools:visibility="visible"
android:visibility="gone"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginRight="@dimen/dp_25"
android:layout_height="@dimen/dp_70">
<TextView
android:id="@+id/tv_material"
android:layout_width="0dp"
android:layout_weight="1"
android:textColor="@drawable/bg_tab_text_color_selector"
android:text="物料信息"
android:background="@drawable/bg_tab_text"
android:gravity="center"
android:textSize="@dimen/sp_32"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:focusable="true"
>
<requestFocus/>
</TextView>
android:layout_marginTop="?attr/qmui_topbar_height"
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_tab"
android:layout_width="match_parent"
android:orientation="horizontal"

<TextView
android:id="@+id/tv_silos"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/bg_tab_text"
android:text="料仓信息"
android:textSize="@dimen/sp_32"
android:gravity="center"
android:textColor="@drawable/bg_tab_text_color_selector"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:focusable="true"
/>
tools:visibility="visible"
android:visibility="gone"
android:paddingTop="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginRight="@dimen/dp_25"
android:layout_height="@dimen/dp_90">
<TextView
android:id="@+id/tv_material"
android:layout_width="0dp"
android:layout_weight="1"
android:textColor="@drawable/bg_tab_text_color_selector"
android:text="物料信息"
android:background="@drawable/bg_tab_text"
android:gravity="center"
android:textSize="@dimen/sp_32"
android:layout_height="match_parent"
>
</TextView>

<TextView
android:id="@+id/tv_silos"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/bg_tab_text"
android:text="料仓信息"
android:textSize="@dimen/sp_32"
android:gravity="center"
android:textColor="@drawable/bg_tab_text_color_selector"
android:layout_height="match_parent"
/>

</LinearLayout>

<com.qmuiteam.qmui.widget.QMUIViewPager
android:id="@+id/view_pager"
android:layout_marginTop="@dimen/dp_20"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"
android:background="?attr/app_content_bg_color" />
</LinearLayout>

<com.qmuiteam.qmui.widget.QMUIViewPager
android:layout_marginTop="@dimen/dp_140"
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"
android:background="?attr/app_content_bg_color" />


<RelativeLayout
android:id="@+id/quanxian"
android:layout_marginTop="@dimen/dp_54"
android:layout_marginTop="?attr/qmui_topbar_height"
android:layout_gravity="top"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -138,7 +135,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 4
- 1
app/src/main/res/layout/activity_system_set.xml View File

@@ -7,6 +7,8 @@
xmlns:tools="http://schemas.android.com/tools">
<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
@@ -15,7 +17,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 1
- 1
app/src/main/res/layout/dialog/layout/dialog_edit_goods.xml View File

@@ -47,7 +47,7 @@
<include
android:id="@+id/layout_mainfoods"
android:layout_width="@dimen/dp_660"
android:layout_height="@dimen/dp_980"
android:layout_height="@dimen/dp_1030"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"


+ 149
- 0
app/src/main/res/layout/dialog/layout/dialog_sub_order.xml View File

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:background="@drawable/bg_round25_white"
android:layout_height="@dimen/dp_900">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80">
<TextView
android:id="@+id/title2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:background="@drawable/bg_round25_top_yellow"
style="@style/TextView_btn_dialog"
android:text="名称"
android:paddingEnd="@dimen/dp_80"
android:paddingStart="@dimen/dp_80"
/>

<ImageView
android:id="@+id/btn_close"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_gravity="end"
style="@style/TextView_btn_dialog"
android:background="@mipmap/ic_clear_white_48dp"
/>
</FrameLayout>


<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="vertical">

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@color/color3"
android:layout_height="@dimen/dp_50">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="商品名称"
android:textAlignment="center"
android:textStyle="bold"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:textColor="@color/white"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:layout_alignParentLeft="true"
android:text="订单总量"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:text="已制作"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:text="取消订单"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>


<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:text="异常订单"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>
</LinearLayout>


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
/>
</LinearLayout>
</RelativeLayout>

</LinearLayout>

</LinearLayout>

+ 37
- 15
app/src/main/res/layout/dialog/layout/layout_add_goods_mainfood.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_660"
android:layout_height="@dimen/dp_980"
android:layout_height="@dimen/dp_1030"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/bg_round25_white">
@@ -316,7 +316,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:layout_height="@dimen/dp_200"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="@dimen/dp_20"
android:gravity="center"
@@ -324,25 +324,47 @@

<TextView
android:id="@+id/btn_to_cook"
android:layout_width="@dimen/dp_255"
android:layout_height="@dimen/dp_120"
android:layout_width="@dimen/dp_350"
android:layout_height="@dimen/dp_150"
android:gravity="center"
android:textSize="@dimen/sp_48"
android:textColor="@color/white"
android:background="@drawable/bg_round25_yellow_btn"
android:text="去烹饪"
/>
<TextView
android:id="@+id/btn_edit_process"
android:layout_width="@dimen/dp_255"
android:layout_height="@dimen/dp_120"
android:layout_marginLeft="@dimen/dp_80"
android:gravity="center"
android:textSize="@dimen/sp_48"
android:textColor="@color/white"
android:background="@drawable/bg_round25_green_btn"
android:text="编辑工序"
/>

<LinearLayout
android:id="@+id/ll_edit"
android:layout_width="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"
android:layout_height="wrap_content">

<TextView
android:id="@+id/btn_edit_process"
android:layout_width="@dimen/dp_255"
android:layout_height="@dimen/dp_90"
android:layout_marginLeft="@dimen/dp_30"
android:background="@drawable/bg_round25_green_btn"
android:gravity="center"
android:text="编辑工序"
android:textColor="@color/white"
android:textSize="@dimen/sp_48" />

<TextView
android:id="@+id/btn_delete"
android:layout_width="@dimen/dp_255"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_30"
android:gravity="center"
android:textSize="@dimen/sp_48"
android:textColor="@color/white"
android:background="@drawable/bg_round25_red_btn"
android:text="删除配方"
/>
</LinearLayout>
</LinearLayout>




+ 3
- 3
app/src/main/res/layout/dialog/layout/layout_edit_goods_sub_attribute.xml View File

@@ -55,6 +55,7 @@
android:layout_height="wrap_content"
android:divider="#00000000"
android:orientation="vertical"
tools:layout_height="@dimen/dp_600"
/>
</FrameLayout>

@@ -63,14 +64,13 @@
android:id="@+id/group_desc"
android:layout_width="wrap_content"
android:textSize="@dimen/sp_32"
android:layout_height="@dimen/dp_80"
android:layout_height="@dimen/dp_120"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginBottom="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:textColor="@color/blue"
tools:text="存在选中组合"
tools:text="存在选中组合\n(没有工序)"
android:gravity="center"
/>



+ 1
- 1
app/src/main/res/layout/fragment_cloud_goods.xml View File

@@ -74,7 +74,7 @@
android:layout_width="match_parent"
android:layout_marginTop="@dimen/dp_90"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>


+ 2
- 1
app/src/main/res/layout/fragment_home_foods.xml View File

@@ -13,7 +13,8 @@
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:text=" 返 回"
android:paddingRight="@dimen/dp_50"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"


+ 62
- 9
app/src/main/res/layout/fragment_home_main.xml View File

@@ -12,7 +12,7 @@

<ImageView
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_height="300dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
@@ -20,15 +20,16 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="700dp"
android:layout_marginTop="400dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="@id/title"
android:layout_marginTop="@dimen/dp_30"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">
>

<LinearLayout
android:id="@+id/ll_classify"
@@ -78,7 +79,6 @@
</LinearLayout>

<LinearLayout
android:id="@+id/yauser_gn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
@@ -129,12 +129,64 @@
/>
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">

<LinearLayout
android:id="@+id/ll_log"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">

<ImageView
android:layout_width="match_parent"
android:layout_height="130dp"
android:src="@mipmap/home_log_ic" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:text="日志记录"
android:layout_gravity="center"
android:textColor="#2C2C2C"
android:textStyle="bold"
/>

</LinearLayout>

<LinearLayout
android:id="@+id/ll_order"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">

<ImageView
android:layout_width="match_parent"
android:layout_height="130dp"
android:src="@mipmap/home_order_ic" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:text="订单统计"
android:layout_gravity="center"
android:textColor="#835555"
android:textStyle="bold"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="230dp"
android:layout_marginTop="300dp"
android:layout_marginTop="200dp"
android:textColor="@color/white"
android:text="主 页"
android:textSize="68sp"
@@ -143,10 +195,11 @@
android:background="@mipmap/bg_shadow"/>

<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginStart="30dp"
android:layout_marginTop="300dp"
android:layout_marginTop="200dp"
android:layout_marginEnd="30dp"
android:textColor="@color/white"
android:text="主 页"
@@ -163,9 +216,9 @@
android:layout_width="@dimen/dp_250"
android:layout_height="@dimen/dp_60"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/_dp_40"
android:layout_marginBottom="@dimen/dp_150"
android:layout_marginBottom="@dimen/dp_145"
android:layout_alignParentBottom="true"
android:text="注销登录"
android:textSize="@dimen/sp_32"
android:textColor="@color/white"


+ 1
- 1
app/src/main/res/layout/fragment_local_goods.xml View File

@@ -79,7 +79,7 @@
android:layout_marginBottom="@dimen/dp_95"
android:layout_toRightOf="@id/recycler_classify"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>


+ 17
- 2
app/src/main/res/layout/fragment_material.xml View File

@@ -19,7 +19,7 @@
<EditText
android:id="@+id/edit"
android:layout_width="@dimen/dp_410"
android:layout_width="@dimen/dp_310"
android:layout_height="@dimen/dp_70"
android:hint="请输入物料名称"
app:layout_constraintLeft_toRightOf="@id/title"
@@ -38,13 +38,28 @@
android:layout_height="@dimen/dp_70"
app:layout_constraintLeft_toRightOf="@id/edit"
app:layout_constraintTop_toTopOf="@id/title"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="@dimen/sp_32"
android:textColor="@color/white"
android:text="添加"
android:background="@drawable/bg_round15_yellow_btn"
/>

<Button
android:id="@+id/btn_synchronous"
android:layout_width="@dimen/dp_190"
android:layout_height="@dimen/dp_70"
app:layout_constraintLeft_toRightOf="@id/btn_add"
app:layout_constraintTop_toTopOf="@id/title"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="@dimen/sp_28"
android:textColor="@color/white"
android:text="下载云端数据"
android:visibility="visible"
android:background="@drawable/bg_round15_yellow_btn"
/>


<TextView
android:id="@+id/desc"
android:layout_width="wrap_content"


+ 53
- 0
app/src/main/res/layout/item/layout/item_log.xml View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:paddingBottom="@dimen/dp_4"
android:paddingTop="@dimen/dp_2"
android:background="@drawable/bg_bottom_line"
android:layout_height="@dimen/dp_50">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.6">
<TextView
android:id="@+id/type"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:layout_alignParentLeft="true"
tools:text="角色操作日志"
android:textColor="@color/black" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2.8">
<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:layout_marginLeft="10dp"
tools:text="yyyy-MM-dd 00:00:00"
android:textColor="@color/black"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4">
<TextView
android:id="@+id/desc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:ellipsize="start"
android:layout_alignParentLeft="true"
tools:text="日志描述"
android:textColor="@color/black"/>
</RelativeLayout>
</LinearLayout>

+ 74
- 0
app/src/main/res/layout/item/layout/item_order.xml View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:id="@+id/root"
android:paddingBottom="@dimen/dp_4"
android:paddingTop="@dimen/dp_2"
android:background="@drawable/bg_bottom_line"
android:layout_height="@dimen/dp_74">

<TextView
android:id="@+id/name"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
tools:text="商品\n名称"
android:ellipsize="end"
android:background="@drawable/input_bj"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:textColor="@color/black"/>

<TextView
android:id="@+id/total"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:textSize="@dimen/sp_24"
android:gravity="center"
android:layout_alignParentLeft="true"
tools:text="1"
android:textColor="@color/black" />

<TextView
android:id="@+id/complete"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:textSize="@dimen/sp_24"
android:gravity="center"
tools:text="2"
android:textColor="@color/black" />

<TextView
android:id="@+id/cancel"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:textSize="@dimen/sp_24"
android:gravity="center"
tools:text="3"
android:textColor="@color/black" />

<TextView
android:id="@+id/error"
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textSize="@dimen/sp_24"
android:gravity="center"
tools:text="1"
android:textColor="@color/black" />
</LinearLayout>

BIN
View File


BIN
View File


+ 2
- 2
app/src/main/res/values/styles.xml View File

@@ -123,8 +123,8 @@
<item name="qmui_topbar_title_color">@color/qmui_config_color_white</item>
<item name="qmui_topbar_subtitle_color">@color/qmui_config_color_white</item>
<item name="qmui_topbar_text_btn_color_state_list">@color/s_topbar_btn_color</item>
<item name="qmui_topbar_height">80dp</item>
<item name="qmui_topbar_image_btn_height">80dp</item>
<item name="qmui_topbar_height">100dp</item>
<item name="qmui_topbar_image_btn_height">100dp</item>
<item name="qmui_topbar_title_text_size">32sp</item>
<item name="android:background">@color/topbj1</item>
</style>


+ 2
- 2
build.gradle View File

@@ -35,8 +35,8 @@ task clean(type: Delete) {

ext { // 统一版本入口
//App版本号
versionCode = 204
versionName = "2.0.4"
versionCode = 206
versionName = "2.0.6"

// 支持Android版本
buildToolsVersion = "33.0.0"


Loading…
Cancel
Save