瀏覽代碼

修改

调味吧台
liup 1 月之前
父節點
當前提交
8e9025bcf5
共有 68 個文件被更改,包括 1683 次插入422 次删除
  1. +2
    -2
      .idea/deploymentTargetSelector.xml
  2. +329
    -0
      .idea/other.xml
  3. +1
    -1
      app/build.gradle
  4. +6
    -0
      app/src/main/java/com/bonait/bnframework/api/Api.java
  5. +126
    -4
      app/src/main/java/com/bonait/bnframework/api/ServerManager.java
  6. +14
    -0
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  7. +12
    -2
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  8. +36
    -17
      app/src/main/java/com/bonait/bnframework/business/OrderServer.java
  9. +4
    -1
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  10. +32
    -6
      app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java
  11. +55
    -17
      app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java
  12. +7
    -1
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_SUBORDER.java
  13. +5
    -2
      app/src/main/java/com/bonait/bnframework/common/db/util/CloudOrderUtil.java
  14. +99
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/SubOrderUtil.java
  15. +32
    -0
      app/src/main/java/com/bonait/bnframework/common/glide/GlideUtil.java
  16. +0
    -37
      app/src/main/java/com/bonait/bnframework/common/helper/MediaPlayerHelper.java
  17. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/linktab/TopItemDecoration.java
  18. +109
    -0
      app/src/main/java/com/bonait/bnframework/common/model/GsonUtil.java
  19. +102
    -0
      app/src/main/java/com/bonait/bnframework/common/model/UploadOrderInfo.java
  20. +20
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java
  21. +11
    -8
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/CloudOrderAdapter.java
  22. +8
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/ddgl_adapter.java
  23. +5
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java
  24. +2
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/newgood_adapter.java
  25. +2
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/newmakegood_adapter.java
  26. +61
    -8
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/CloudOrderFragment.java
  27. +27
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MainTabFragment.java
  28. +53
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  29. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java
  30. +27
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/LogActivity.java
  31. +41
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/OrderListActivity.java
  32. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SalesStatisticsActivity.java
  33. +18
    -11
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SystemParameterActivity.java
  34. +1
    -33
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/CopyRecipeDialog.java
  35. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java
  36. +45
    -19
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LookOrderGoodsDialog.java
  37. +17
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_makegood_control.java
  38. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java
  39. +18
    -0
      app/src/main/res/drawable/bg_white_round_btn.xml
  40. +15
    -4
      app/src/main/res/layout/activity_log.xml
  41. +1
    -2
      app/src/main/res/layout/activity_login.xml
  42. +46
    -11
      app/src/main/res/layout/activity_orderlist.xml
  43. +7
    -4
      app/src/main/res/layout/activity_salesstatistics.xml
  44. +1
    -0
      app/src/main/res/layout/activity_systemparameter.xml
  45. +21
    -8
      app/src/main/res/layout/datatab/layout/ddgl_item.xml
  46. +48
    -0
      app/src/main/res/layout/fragment_main_tab.xml
  47. +25
    -19
      app/src/main/res/layout/fragment_make_good.xml
  48. +0
    -1
      app/src/main/res/layout/fragment_make_order.xml
  49. +0
    -1
      app/src/main/res/layout/item/layout/dialog_add_pf.xml
  50. +0
    -1
      app/src/main/res/layout/item/layout/dialog_add_pf_home.xml
  51. +0
    -1
      app/src/main/res/layout/item/layout/dialog_add_silos_ck.xml
  52. +1
    -1
      app/src/main/res/layout/item/layout/fragment_item_plc_control.xml
  53. +127
    -105
      app/src/main/res/layout/item/layout/item_cloud_order.xml
  54. +5
    -2
      app/src/main/res/layout/item/layout/item_right_lc.xml
  55. +54
    -69
      app/src/main/res/layout/item/layout/loadinggood_item.xml
  56. +0
    -3
      app/src/main/res/layout/item/layout/silos_jiaoyan_item.xml
  57. 二進制
     
  58. 二進制
     
  59. 二進制
     
  60. 二進制
     
  61. 二進制
     
  62. 二進制
     
  63. 二進制
     
  64. 二進制
     
  65. 二進制
     
  66. 二進制
     
  67. 二進制
     
  68. 二進制
     

+ 2
- 2
.idea/deploymentTargetSelector.xml 查看文件

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-11-26T09:13:47.214486600Z">
<DropdownSelection timestamp="2024-11-29T06:04:26.548960300Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="Default" identifier="serial=192.168.1.3:5555;connection=73afb854" />
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=56c9cbdc" />
</handle>
</Target>
</DropdownSelection>


+ 329
- 0
.idea/other.xml 查看文件

@@ -0,0 +1,329 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="direct_access_persist.xml">
<option name="deviceSelectionList">
<list>
<PersistentDeviceSelectionData>
<option name="api" value="27" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="F01L" />
<option name="id" value="F01L" />
<option name="manufacturer" value="FUJITSU" />
<option name="name" value="F-01L" />
<option name="screenDensity" value="360" />
<option name="screenX" value="720" />
<option name="screenY" value="1280" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="28" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="SH-01L" />
<option name="id" value="SH-01L" />
<option name="manufacturer" value="SHARP" />
<option name="name" value="AQUOS sense2 SH-01L" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="Lenovo" />
<option name="codename" value="TB370FU" />
<option name="id" value="TB370FU" />
<option name="manufacturer" value="Lenovo" />
<option name="name" value="Tab P12" />
<option name="screenDensity" value="340" />
<option name="screenX" value="1840" />
<option name="screenY" value="2944" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="a51" />
<option name="id" value="a51" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A51" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="akita" />
<option name="id" value="akita" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="b0q" />
<option name="id" value="b0q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S22 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="32" />
<option name="brand" value="google" />
<option name="codename" value="bluejay" />
<option name="id" value="bluejay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="caiman" />
<option name="id" value="caiman" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro" />
<option name="screenDensity" value="360" />
<option name="screenX" value="960" />
<option name="screenY" value="2142" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="comet" />
<option name="id" value="comet" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro Fold" />
<option name="screenDensity" value="390" />
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="29" />
<option name="brand" value="samsung" />
<option name="codename" value="crownqlteue" />
<option name="id" value="crownqlteue" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Note9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2220" />
<option name="screenY" value="1080" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="dm3q" />
<option name="id" value="dm3q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S23 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="e1q" />
<option name="id" value="e1q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix_camera" />
<option name="id" value="felix_camera" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold (Camera-enabled)" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="gts8uwifi" />
<option name="id" value="gts8uwifi" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Tab S8 Ultra" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1848" />
<option name="screenY" value="2960" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="husky" />
<option name="id" value="husky" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8 Pro" />
<option name="screenDensity" value="390" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="motorola" />
<option name="codename" value="java" />
<option name="id" value="java" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="G20" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="komodo" />
<option name="id" value="komodo" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro XL" />
<option name="screenDensity" value="360" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="lynx" />
<option name="id" value="lynx" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="google" />
<option name="codename" value="oriole" />
<option name="id" value="oriole" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="panther" />
<option name="id" value="panther" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q5q" />
<option name="id" value="q5q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold5" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1812" />
<option name="screenY" value="2176" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q6q" />
<option name="id" value="q6q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1856" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="r11" />
<option name="id" value="r11" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Watch" />
<option name="screenDensity" value="320" />
<option name="screenX" value="384" />
<option name="screenY" value="384" />
<option name="type" value="WEAR_OS" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="redfin" />
<option name="id" value="redfin" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 5" />
<option name="screenDensity" value="440" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="shiba" />
<option name="id" value="shiba" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="tangorpro" />
<option name="id" value="tangorpro" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Tablet" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="tokay" />
<option name="id" value="tokay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2424" />
</PersistentDeviceSelectionData>
</list>
</option>
</component>
</project>

+ 1
- 1
app/build.gradle 查看文件

@@ -183,7 +183,7 @@ 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.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如4.0.3

api 'org.greenrobot:eventbus:3.1.1'



+ 6
- 0
app/src/main/java/com/bonait/bnframework/api/Api.java 查看文件

@@ -23,4 +23,10 @@ public interface Api {
Call<ResResult<ArrayList<UploadTData>>> uploadDeviceLog(@Url String url,
@Body RequestBody body);

/**
* 上传配方使用详情
*/
@POST
Call<ResResult<ArrayList<UploadTData>>> uploadRecipeUseDetail(@Url String url,
@Body RequestBody body);
}

+ 126
- 4
app/src/main/java/com/bonait/bnframework/api/ServerManager.java 查看文件

@@ -3,21 +3,31 @@ package com.bonait.bnframework.api;
import android.content.Context;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.HBL.Dialog.DialogManager;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.api.net.HttpUtil;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_ALERTLOG;
import com.bonait.bnframework.common.db.mode.BPA_LOG;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.res.UserLogEnum;
import com.bonait.bnframework.common.db.util.SubOrderUtil;
import com.bonait.bnframework.common.helper.MessageLog;
import com.bonait.bnframework.common.iot.manager.ToastUtils;
import com.bonait.bnframework.common.model.GsonUtil;
import com.bonait.bnframework.common.model.UploadOrderInfo;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.modules.home.util.WaitProcessUtil;

import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import okhttp3.MediaType;
import okhttp3.MultipartBody;
@@ -26,7 +36,8 @@ import retrofit2.Call;

public class ServerManager {

public static final String mainUrl = "https://cfv.black-pa.com/";
// public static final String mainUrl = "https://cfv.black-pa.com/";
public static final String mainUrl = "http://192.168.1.50:5007/";

/**
* 上传日志文件
@@ -44,6 +55,12 @@ public class ServerManager {
resUpEnqueue(call, callback);
}

/**
* 开始上传文件
* @param context
* @param file
* @param showTip
*/
public static void uploadDeviceLog(Context context ,File file,boolean showTip){
if(!file.exists()){
ToastUtils.showToast("日志文件不存在!");
@@ -62,7 +79,7 @@ public class ServerManager {
if(showTip){
WaitProcessUtil.getInstance().dismiss();
}
LogUtils.d("上传文件成功");
ToastUtils.showToast("上传文件成功");
}

@Override
@@ -71,7 +88,7 @@ public class ServerManager {
if(showTip){
WaitProcessUtil.getInstance().dismiss();
}
LogUtils.d("上传文件失败"+msg);
ToastUtils.showToast("上传文件失败"+msg);
}

@Override
@@ -80,11 +97,116 @@ public class ServerManager {
if(showTip){
WaitProcessUtil.getInstance().dismiss();
}
LogUtils.d("上传文件失败"+message);
ToastUtils.showToast("上传文件失败"+message);
}
});
}

/**
* 开始上传订单信息
* @param context
* @param showTip
*/
public static void btnUploadOrder(Context context,boolean showTip){
if(showTip){
WaitProcessUtil.getInstance().show(context,"请稍等","正在上传所有配方详情,请耐心等待...");
}
MessageLog.ShowUserMessage(UserLogEnum.上传日志,"上传配方使用记录");
ServerManager.uploadOrder(showTip,new IHttpCallBack<Object>() {
@Override
public void onSuccess(Object responseData) {
if(showTip){
WaitProcessUtil.getInstance().dismiss();
ToastUtils.showToast("上传配方使用记录成功");
}
MessageLog.ShowUserMessage(UserLogEnum.上传日志,"上传配方使用记录成功");

ThreadManager.get().execute(new Runnable() {
@Override
public void run() {
ArrayList<BPA_SUBORDER> suborderList = SubOrderUtil.GetSubOrderNoUpload();
for(BPA_SUBORDER bean : suborderList){
bean.isUpload = "true";
SubOrderUtil.update(bean);
}
}
});
}

@Override
public void onError(int failCode,String msg) {
MessageLog.ShowUserMessage(UserLogEnum.上传日志,"上传配方使用记录失败:"+msg);
if(showTip){
WaitProcessUtil.getInstance().dismiss();
ToastUtils.showToast("上传配方使用记录失败:failCode="+failCode+" description="+msg);
}
}

@Override
public void onFailed(int failCode, Throwable throwable, String message) {
MessageLog.ShowUserMessage(UserLogEnum.上传日志,"上传配方使用记录失败:"+message);
if(showTip){
WaitProcessUtil.getInstance().dismiss();
ToastUtils.showToast("上传配方使用记录失败:"+message);
}
}
});
}

/**
* 上传订单信息
* @param callback
*/
public static void uploadOrder(boolean showTip,IHttpCallBack<Object> callback) {
ArrayList<BPA_SUBORDER> suborderList = SubOrderUtil.GetSubOrderNoUpload();
List<UploadOrderInfo> uploadOrderInfoList = new ArrayList<>();

for(BPA_SUBORDER bean : suborderList){
boolean has =false;
for(UploadOrderInfo info :uploadOrderInfoList){
if(info.OrderId.equals(bean.orderID)){
UploadOrderInfo.OrderDetail detail = new UploadOrderInfo.OrderDetail();
detail.AttributeName = bean.exp.replace("/","-");
detail.GoodsName = bean.goodsName;
detail.Status = bean.status;
detail.UpdateTime =bean.createTime;
info.getOrderDetailList().add(detail);
has = true;
break;
}
}
if(!has){
UploadOrderInfo uploadOrderInfo = new UploadOrderInfo();
uploadOrderInfo.AutoKey = Integer.parseInt(ConfigName.getInstance().DeviceAutoKey);
uploadOrderInfo.OrderId = bean.orderID;
uploadOrderInfo.IsDevice = Boolean.parseBoolean(bean.isDevice);
uploadOrderInfo.Number = bean.numId.isEmpty()?0:Integer.parseInt(bean.numId);
List<UploadOrderInfo.OrderDetail> orderDetails = new ArrayList<>();
UploadOrderInfo.OrderDetail orderDetail = new UploadOrderInfo.OrderDetail();
orderDetail.AttributeName = bean.exp.replace("/","-");
orderDetail.GoodsName = bean.goodsName;
orderDetail.Status = bean.status;
orderDetail.UpdateTime =bean.createTime;
orderDetails.add(orderDetail);
uploadOrderInfo.OrderDetailList = orderDetails;
uploadOrderInfoList.add(uploadOrderInfo);
}
}

if(suborderList.isEmpty()){
if(showTip){
ToastUtils.showToast("订单已全部上传,没有新的订单记录了");
}
WaitProcessUtil.getInstance().dismiss();
return;
}
String url = mainUrl + "api/order/uploadOrder";
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
GsonUtil.object2JsonStr(uploadOrderInfoList));
Call call = HttpUtil.getService(Api.class).uploadRecipeUseDetail(url,body);
resUpEnqueue(call, callback);
}


/**
* @param call


+ 14
- 0
app/src/main/java/com/bonait/bnframework/business/ConfigData.java 查看文件

@@ -157,11 +157,14 @@ public class ConfigData {

BPA_SYSTEMSET find_99 = null;
BPA_SYSTEMSET find_100 = null;
BPA_SYSTEMSET find_5 = null;
for (BPA_SYSTEMSET item : bpa_systemsets) {
if (item.type == -99) {
find_99 = item;
} else if (item.type == -100) {
find_100 = item;
}else if (item.type == 5) {
find_5 = item;
}
}
if (find_99 == null) {
@@ -180,6 +183,14 @@ public class ConfigData {
set.userID = ConfigName.getInstance().user.userID;
QueryDB.AddSystemset(set);
}
if (find_5 == null) {
BPA_SYSTEMSET set = new BPA_SYSTEMSET();
set.type = 5;
set.value = String.valueOf(ConfigName.getInstance().orderNum);
set.deviceID = ConfigName.getInstance().DeviceId;
set.userID = ConfigName.getInstance().user.userID;
QueryDB.AddSystemset(set);
}

bpa_systemsets = QueryDB.GetSystemsetALL();
for (BPA_SYSTEMSET item : bpa_systemsets) {
@@ -202,6 +213,9 @@ public class ConfigData {
case 4:
ConfigName.getInstance().DeviceAutoKey = item.value;
break;
case 5:
ConfigName.getInstance().orderNum = Integer.parseInt(item.value);
break;
}

}


+ 12
- 2
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java 查看文件

@@ -395,6 +395,7 @@ public class ExecuteTheRecipe {
try {
if(IsMakeGood && GoodMake!=null)
{
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_start);
LogUtils.d("商品制作线程 GoodMake = "+GoodMake.toString());
ArrayList<ResGoodsRecipe> recipes= GoodMake.recipes;

@@ -503,16 +504,23 @@ public class ExecuteTheRecipe {
}
//更新缓存商品制作列表状态
count += goodsRecipes.size();
DataBus.getInstance().UpdateGoodsMake(GoodMake.subOrder.id, "步骤【" + key + "】:" + RecipesNames + "-配料完成!", count, key, true);
DataBus.getInstance().UpdateGoodsMake(GoodMake.subOrder.id, "步骤【" + key + "】:" + RecipesNames + "-配料完成!", count, key, false);
// MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + GoodMake.good.name + "]步骤【" + key + "】下发" + RecipesNames + "执行完成!");
}

DataBus.getInstance().DeleteGoodsMake(GoodMake.subOrder.id,isError);
if(isError){
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + GoodMake.good.name + "]-订单执行失败!");
// MediaPlayerHelper.getInstance().PlaySound(R.raw.plks);
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_error);
GoodMake.subOrder.status=3;
QueryDB.UpdateSubOrder(GoodMake.subOrder);

}else {
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + GoodMake.good.name + "]-订单执行完成,请取餐!");

MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_finish);
GoodMake.subOrder.status=1;
QueryDB.UpdateSubOrder(GoodMake.subOrder);
}

GoodMake=null;
@@ -525,6 +533,8 @@ public class ExecuteTheRecipe {
ToastUtils.error("异常信息:" + ex.getMessage());
GoodMake=null;
IsMakeGood=false;
GoodMake.subOrder.status=3;
QueryDB.UpdateSubOrder(GoodMake.subOrder);
}
Thread.sleep(500);
}


+ 36
- 17
app/src/main/java/com/bonait/bnframework/business/OrderServer.java 查看文件

@@ -3,6 +3,7 @@ package com.bonait.bnframework.business;
import android.util.Log;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODPROPERTY;
@@ -11,36 +12,33 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME;
import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE;
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_ORDER_GOODS_CLOUD;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_HEADER_CLOUD;
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.res.ResOrderCall;
import com.bonait.bnframework.common.db.res.ResOrderCloudList;
import com.bonait.bnframework.common.db.res.UserLogEnum;
import com.bonait.bnframework.common.db.util.CloudGoodsUtil;
import com.bonait.bnframework.common.db.util.CloudOrderUtil;
import com.bonait.bnframework.common.db.util.SubOrderUtil;
import com.bonait.bnframework.common.helper.AES;
import com.bonait.bnframework.common.helper.I.IMessage;
import com.bonait.bnframework.common.helper.I.IRun;
import com.bonait.bnframework.common.helper.I.IThread;
import com.bonait.bnframework.common.helper.Json;
import com.bonait.bnframework.common.helper.MQTT;
import com.bonait.bnframework.common.helper.MediaPlayerHelper;
import com.bonait.bnframework.common.helper.MessageLog;
import com.bonait.bnframework.common.helper.ThreadManager;
import com.bonait.bnframework.common.helper.mode.BPAPackage;
import com.bonait.bnframework.common.helper.mode.BPA_GoodsInfo;
import com.bonait.bnframework.common.helper.mode.BPA_HeartPackage;
import com.bonait.bnframework.common.helper.mode.BatchingsInfo;
import com.bonait.bnframework.common.helper.mode.Batchingstechnology;
import com.bonait.bnframework.common.helper.mode.BomAttributeValueReInfo;
import com.bonait.bnframework.common.helper.mode.GoodsAttributeInfo;
import com.bonait.bnframework.common.helper.mode.GoodsAttributeValueInfo;
import com.bonait.bnframework.common.helper.mode.GoodsBom;
import com.bonait.bnframework.common.helper.mode.GyAction;
import com.bonait.bnframework.common.helper.mode.Message_HeartModel;
import com.bonait.bnframework.common.helper.mode.PushDeviceGoods;
import com.bonait.bnframework.common.helper.mode.TechnologyActions;
import com.bonait.bnframework.common.iot.manager.ToastUtils;
import com.bonait.bnframework.common.model.MqttMessageBase;
import com.bonait.bnframework.event.FreshCloudOrderEvent;
@@ -56,9 +54,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
* 订单服务
@@ -114,6 +110,7 @@ public class OrderServer {
pushOrderCall(model.getMessageId());
if( resOrderCloudList.getGoodList()!=null){
addOrderInfo(resOrderCloudList);
MediaPlayerHelper.getInstance().PlaySound(R.raw.add_order);
}
}
}
@@ -197,6 +194,24 @@ public class OrderServer {
bean1.GoodsId = orderInfo.getGoodList().get(j).GoodsId;
bean1.AttributeIds = orderInfo.getGoodList().get(j).AttributeIds;
goodsList.add(bean1);

BPA_SUBORDER bpaSuborder = QueryDB.GetSubOrderId(bean1.id);
if(bpaSuborder!=null){
QueryDB.DeleteSubOrder(bpaSuborder);
}

BPA_SUBORDER suborder = new BPA_SUBORDER();
suborder.id = bean1.id;
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = bean1.orderId;
suborder.goodsID = bean1.GoodsId;
suborder.goodsName = bean1.GoodsName;
suborder.number = 1;
suborder.status = 0;
suborder.isDevice = "false";
suborder.exp = bean1.AttributeNames;
QueryDB.AddSubOrder(suborder);
}
List<String> namesList = new ArrayList<>();
for (LinkedHashMap.Entry<String, Integer> map : nameMap.entrySet()) {
@@ -234,15 +249,19 @@ public class OrderServer {
MQTT.get().publish(ConfigName.getInstance().mqtt_hearttopic,msg);
}

public void pushOrderCall(String messageId) throws Exception{
ResOrderCall resOrderCall = new ResOrderCall();
resOrderCall.success = true;
resOrderCall.errors = "";
resOrderCall.messageId = messageId;
String Message= new Json<ResOrderCall>().objectToJson(ResOrderCall.class,resOrderCall);
String msg= new AES().Encrypt(Message);
LogUtils.d(" pushOrderCall Message="+Message);
MQTT.get().publish(ConfigName.getInstance().mqtt_topic_call.replace("{dto.AutoKey}",ConfigName.getInstance().ClientAutoKey),msg);
public void pushOrderCall(String messageId) {
try{
ResOrderCall resOrderCall = new ResOrderCall();
resOrderCall.success = true;
resOrderCall.errors = "";
resOrderCall.messageId = messageId;
String Message= new Json<ResOrderCall>().objectToJson(ResOrderCall.class,resOrderCall);
String msg= new AES().Encrypt(Message);
LogUtils.d(" pushOrderCall Message="+Message);
MQTT.get().publish(ConfigName.getInstance().mqtt_topic_call.replace("{dto.AutoKey}",ConfigName.getInstance().DeviceAutoKey),msg);
}catch (Exception e){
ToastUtils.showToast("mqtt回调异常");
}
}

/**


+ 4
- 1
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java 查看文件

@@ -63,6 +63,8 @@ public class ConfigName {
//endregion

public static final String SHARE_KEY_loginNum = "SHARE_KEY_loginNum";
public static final String SHARE_KEY_orderDate = "SHARE_KEY_orderDate";
public int orderNum = 1;

//region 程序进入界面
public Context dishesCon;
@@ -126,7 +128,8 @@ public class ConfigName {
*/
public String mqtt_topic = "/kitchen/order/{dto.AutoKey}/order_push";
public String mqtt_topic_call = "/kitchen/order/{dto.AutoKey}/order_callback";
public String mqtt_hearttopic = "UP/MORKT/HEARTBEAT";
// public String mqtt_hearttopic = "UP/MORKT/HEARTBEAT";
public String mqtt_hearttopic = "/kitchen/device/deviceHeartBeat";
//endregion

//region 环境配置


+ 32
- 6
app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java 查看文件

@@ -260,7 +260,7 @@ public class DataBus {

if(loadinggoodAdapter!=null)
{
loadinggoodAdapter.Speak(R.raw.plks);
// loadinggoodAdapter.Speak(R.raw.plks);
loadinggoodAdapter.refresh();
}
}catch(Exception e){
@@ -284,7 +284,7 @@ public class DataBus {
{
if(GoodsMake.get(m).subOrder.status==0)
{
GoodsMake.get(m).subOrder.status=1;
GoodsMake.get(m).subOrder.status=2;
QueryDB.UpdateSubOrder(GoodsMake.get(m).subOrder);
}

@@ -293,7 +293,7 @@ public class DataBus {
GoodsMake.get(m).makeProcess=(int)(((count*1.00)/ GoodsMake.get(m).recipes.size())*100);

if(loadinggoodAdapter!=null) {
loadinggoodAdapter.Speak(R.raw.plzqsh);
// loadinggoodAdapter.Speak(R.raw.plzqsh);
loadinggoodAdapter.refresh();
}
return;
@@ -317,7 +317,7 @@ public class DataBus {
item.makeStatus=MakeStatus.制作完成;
item.makeMs="";
item.makeProcess=100;
item.subOrder.status=isError?5:2;
item.subOrder.status=isError?3:1;
QueryDB.UpdateSubOrder(item.subOrder);
good=item;
}
@@ -330,7 +330,7 @@ public class DataBus {

if(loadinggoodAdapter!=null)
{
loadinggoodAdapter.Speak(R.raw.plwc);
// loadinggoodAdapter.Speak(R.raw.plwc);
loadinggoodAdapter.refresh();
}

@@ -366,7 +366,7 @@ public class DataBus {

if(loadinggoodAdapter!=null)
{
loadinggoodAdapter.Speak(R.raw.plwc);
// loadinggoodAdapter.Speak(R.raw.plwc);
loadinggoodAdapter.refresh();
}
if(ExecuteTheRecipe.GoodMake!=null &&ExecuteTheRecipe.GoodMake.subOrder!=null && ExecuteTheRecipe.GoodMake.subOrder.id!=null){
@@ -379,6 +379,32 @@ public class DataBus {
}catch(Exception e){
}
}

public void cancelAllGoodsMake()
{
try
{
for (ResGoodsMake item:GoodsMake)
{
item.makeStatus=MakeStatus.取消;
item.makeMs="";
item.makeProcess=100;
item.subOrder.status=4;
QueryDB.UpdateSubOrder(item.subOrder);
}

GoodsMake.clear();

if(loadinggoodAdapter!=null)
{
// loadinggoodAdapter.Speak(R.raw.plwc);
loadinggoodAdapter.refresh();
}
ExecuteTheRecipe.GoodMake = null;
ExecuteTheRecipe.IsMakeGood = false;
}catch(Exception e){
}
}
//endregion

//region 配方数据


+ 55
- 17
app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java 查看文件

@@ -1761,6 +1761,7 @@ public class QueryDB {
* @return 是否成功
*/
public static boolean AddSubOrder(BPA_SUBORDER data) {
data.isUpload = "false";
return Add(BPA_SUBORDER.class, data);
}

@@ -1823,7 +1824,12 @@ public class QueryDB {
* @param data
*/
public static void UpdateSubOrder(BPA_SUBORDER data) {
Update(BPA_SUBORDER.class, data);
data.isUpload = "false";
if(GetSubOrderId(data.id)==null){
AddSubOrder(data);
}else {
Update(BPA_SUBORDER.class, data);
}
}

/**
@@ -1872,6 +1878,18 @@ public class QueryDB {
return data;
}

public static BPA_SUBORDER GetSubOrderId(String id) {
String orderby = Desc_Time_Up;//先按排序 创建时间倒序
BPA_SUBORDER bean = null;
String where = "isDelete=? and id=?";
String[] args = new String[]{"0", id};
ArrayList<Object> obj = Get(BPA_SUBORDER.class, where, args, orderby);
for (Object k : obj) {
bean = (BPA_SUBORDER) k;
}
return bean;
}

public static BPA_SUBORDER GetSubOrderById(String orderId) {
String orderby = Desc_Time_Up;//先按排序 创建时间倒序
BPA_SUBORDER bean = null;
@@ -1890,10 +1908,10 @@ public class QueryDB {
* @return
*/
public static ArrayList<BPA_SUBORDER> GetSubOrdersTodayNoMake() {
String orderby = Desc_Time_Down;//先按排序 创建时间倒序
String orderby = Desc_Time_Up;//先按排序 创建时间倒序
String sta=new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date());
String where = "isDelete=? and createTime>=? and status=0";
String[] args = new String[]{"0", sta};
String where = "isDelete=? and createTime>=? and status=0 and isDevice=?";
String[] args = new String[]{"0", sta,"true"};

ArrayList<BPA_SUBORDER> data = new ArrayList<>();
ArrayList<Object> obj = Get(BPA_SUBORDER.class, where, args, orderby);
@@ -1931,6 +1949,8 @@ public class QueryDB {
sub.goodsID = o.goodsID;
sub.number = o.number;
sub.status = o.status;
sub.isDevice = o.isDevice;
sub.isUpload = o.isUpload;


sub.id = o.id;
@@ -1942,33 +1962,35 @@ public class QueryDB {
sub.isDelete = o.isDelete;
sub.exp = o.exp;

BPA_GOODS good = null;
for (BPA_GOODS i : goods) {
if (i.id.equals(o.goodsID)) {
good = i;
break;
}
}
if (good != null) {
sub.goodsName = good.name;
// BPA_GOODS good = null;
// for (BPA_GOODS i : goods) {
// if (i.id.equals(o.goodsID)) {
// good = i;
// break;
// }
// }
// if (good != null) {
sub.goodsName = o.goodsName;
sub.numId = o.numId;
// * 0等待 1完成 2执行中 3异常 4删除/移除
switch (o.status) {
case 0:
sub.statusText = "未开始";
break;
case 1:
sub.statusText = "制作";
sub.statusText = "制作";
break;
case 2:
sub.statusText = "制作";
sub.statusText = "制作";
break;
case 3:
sub.statusText = "已超时";
sub.statusText = "异常";
break;
case 4:
sub.statusText = "已取消";
break;
}
}
// }

boolean IsText = false;
if (!text.isEmpty()) {
@@ -2403,6 +2425,18 @@ public class QueryDB {
Update(BPA_SYSTEMSET.class, data);
}

public static BPA_SYSTEMSET GetSystemsetByType(int type) {
String orderby = Desc_Time_Up;
String where = "isDelete=? and type=?";
String[] args = new String[]{"0",type+""};
BPA_SYSTEMSET bean = null;
ArrayList<Object> obj = Get(BPA_SYSTEMSET.class, where, args, orderby);
for (Object k : obj) {
bean = ((BPA_SYSTEMSET) k);
}
return bean==null?new BPA_SYSTEMSET():bean;
}

/**
* 删除系统设置
* add fengyoufu 20230413
@@ -3712,6 +3746,10 @@ public class QueryDB {
((BPA_SUBORDER) data).goodImg = cursor.getString((int) cursor.getColumnIndex("goodImg"));
((BPA_SUBORDER) data).originalMoney = cursor.getDouble((int) cursor.getColumnIndex("originalMoney"));
((BPA_SUBORDER) data).realMoney = cursor.getDouble((int) cursor.getColumnIndex("realMoney"));
((BPA_SUBORDER) data).isDevice = cursor.getString((int) cursor.getColumnIndex("isDevice"));
((BPA_SUBORDER) data).isUpload = cursor.getString((int) cursor.getColumnIndex("isUpload"));
((BPA_SUBORDER) data).goodsName = cursor.getString((int) cursor.getColumnIndex("goodsName"));
((BPA_SUBORDER) data).numId = cursor.getString((int) cursor.getColumnIndex("numId"));
break;
case "BPA_ALERTLOG":
data = new BPA_ALERTLOG();


+ 7
- 1
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_SUBORDER.java 查看文件

@@ -14,11 +14,17 @@ public class BPA_SUBORDER extends ModeBase{
//数量:例如 *1 *2
public int number;
/**
* 状态:0 未开始 1 制作中 2 已制作 3 已超时 4 取消
* 0等待 1完成 2执行中 3异常 4删除/移除
*/
public int status;
//商品图片
public String goodImg;
public double originalMoney;//原价
public double realMoney;//实际金额
public String isDevice = "true";//是否是设备订单
public String isUpload = "false";
public String goodsName;
public String numId="0";


}

+ 5
- 2
app/src/main/java/com/bonait/bnframework/common/db/util/CloudOrderUtil.java 查看文件

@@ -9,7 +9,9 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_HEADER_CLOUD;
import com.bonait.bnframework.common.helper.Tools;

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

@@ -39,8 +41,9 @@ public class CloudOrderUtil {
*/
public static ArrayList<BPA_ORDER_HEADER_CLOUD> GetALL() {
String orderby = QueryDB.Desc_Time_Up;
String where = "isDelete=? and status = 0";
String[] args = new String[]{"0"};
String sta=new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date());
String where = "isDelete=? and status = 0 and date>=?";
String[] args = new String[]{"0",sta};
ArrayList<BPA_ORDER_HEADER_CLOUD> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_HEADER_CLOUD.class, where, args, orderby);
for (Object k : obj) {


+ 99
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/SubOrderUtil.java 查看文件

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

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;

import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_HEADER_CLOUD;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.helper.Tools;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* @author: liup
* @description:
* @date: 2024/11/27 13:34.
*/
public class SubOrderUtil {
/**
* 获取所有订单子表
*
* @return
*/
public static ArrayList<BPA_SUBORDER> GetSubOrderNoUpload() {
String orderby = QueryDB.Desc_Time_Up;//先按排序 创建时间倒序
String where = "isDelete=? and isUpload=?";
String[] args = new String[]{"0","false"};
ArrayList<BPA_SUBORDER> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_SUBORDER.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_SUBORDER) k);
}
return data;
}

public static boolean update(BPA_SUBORDER data) {
return QueryDB.Update(BPA_SUBORDER.class, data);
}

/**
* 批量新增
* @param c
* @param list
* @return
*/
public static boolean AddList(Class c, List<BPA_SUBORDER> list) {
if(list.isEmpty()){
return false;
}
QueryDB.lock.lock();
boolean isSucess = false;
SQLiteDatabase db = QueryDB.helper.getWritableDatabase();
try {
long insert=-1;
db.beginTransaction();
for(int i = 0; i < list.size(); i++){
ContentValues cv = new ContentValues();

Map<String, Object> map = Tools.getObjValue(list.get(i));
if (map.get("id").toString().isEmpty())
return false;
for (String key : map.keySet()) {
Object value = map.get(key);
if (value instanceof String) {
cv.put(key, (String) value);
} else if (value instanceof Integer) {
cv.put(key, ((Integer) value).intValue());
} else if (value instanceof Double) {
cv.put(key, ((Double) value).doubleValue());
} else if (value instanceof Float) {
cv.put(key, ((Float) value).floatValue());
} else if (value instanceof Long) {
cv.put(key, ((Long) value).longValue());
} else if (value instanceof Boolean) {
cv.put(key, ((Boolean) value).booleanValue());
}
}
insert = db.insertOrThrow(c.getSimpleName(), null, cv);
if (insert == -1) {
throw new Exception("Failed to insert data at index " + i);
}
}

db.setTransactionSuccessful();

isSucess = insert > 0;
} catch (Exception e) {
// db.close();
isSucess = false;
} finally {
db.endTransaction();
db.close();
QueryDB.lock.unlock();
}
return isSucess;
}
}

+ 32
- 0
app/src/main/java/com/bonait/bnframework/common/glide/GlideUtil.java 查看文件

@@ -114,6 +114,38 @@ public class GlideUtil {
.into(imageView);
}


public static void showImageWithRadius(Context context, int urlId, ImageView imageView,int placeId,int radius) {
if (context == null) {
return;
}
setType(imageView);
GlideApp.with(context)
.load(urlId)
.addListener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model,
Target<Drawable> target, boolean isFirstResource) {
return false;
}

@Override
public boolean onResourceReady(Drawable resource, Object model,
Target<Drawable> target, DataSource dataSource,
boolean isFirstResource) {
if (imageView == null) {
return false;
}
imageView.setBackground(null);
return false;
}
})
.transition(DrawableTransitionOptions.withCrossFade(CROSS_FADE_DURATION))
// .apply(RequestOptions.bitmapTransform(new RoundedCorners(RADIUS)))
.apply(new RequestOptions().transform(new FitXYRoundRadiusTransform(radius)))
.into(imageView);
}

private static void setType(ImageView imageView){//硬件加速
imageView.setLayerType(View.LAYER_TYPE_HARDWARE,null);
}


+ 0
- 37
app/src/main/java/com/bonait/bnframework/common/helper/MediaPlayerHelper.java 查看文件

@@ -46,44 +46,7 @@ public class MediaPlayerHelper {
mPlayer.release(); }

}
public int GetStringID(String str)
{
if(str=="配料开始")return R.raw.plks;///下面把要写的rawid 复制粘贴到此处
else if(str=="配料完成")return R.raw.plwc;///下面把要写的rawid 复制粘贴到此处
else if(str=="配料中请稍后")return R.raw.plzqsh;///下面把要写的rawid 复制粘贴到此处
else if(str=="清洗开始请稍后")return R.raw.qxksqsh;///下面把要写的rawid 复制粘贴到此处
else if(str=="清洗完成")return R.raw.qxwc;///下面把要写的rawid 复制粘贴到此处
else return R.raw.plwc;
}

public int GetSJ()
{
Random rand = new Random();
int randNum = rand.nextInt(5);
if(randNum==0)return R.raw.plks;///下面把要写的rawid 复制粘贴到此处
else if(randNum==1)return R.raw.plwc;///下面把要写的rawid 复制粘贴到此处
else if(randNum==2)return R.raw.plzqsh;///下面把要写的rawid 复制粘贴到此处
else if(randNum==3)return R.raw.qxksqsh;///下面把要写的rawid 复制粘贴到此处
else if(randNum==4)return R.raw.qxwc;///下面把要写的rawid 复制粘贴到此处
else return R.raw.plwc;
}

//播放语音
public void PlaySound(String text)
{
if(context==null )
{
return;
}

if (mPlayer!=null){ //判断当mPlayer不为空的时候
mPlayer.stop(); //先结束上一个播放内容
mPlayer.release();
}
mPlayer = MediaPlayer.create(context, GetStringID(text)); //添加本地资源
mPlayer.setLooping(false);//设置不循环
mPlayer.start(); //开始播放
}
//播放语音
public void PlaySound(int id)
{


+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/linktab/TopItemDecoration.java 查看文件

@@ -22,7 +22,7 @@ public class TopItemDecoration extends RecyclerView.ItemDecoration{

public Context mContext;
//间隔高度
private int mHeight = 60;
private int mHeight = 30;
//矩形画笔
private Paint mPaint=new Paint();
//标签画笔


+ 109
- 0
app/src/main/java/com/bonait/bnframework/common/model/GsonUtil.java 查看文件

@@ -0,0 +1,109 @@
package com.bonait.bnframework.common.model;

import android.content.Context;
import android.content.res.AssetManager;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonWriter;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;

/**
* Gson工具类
*
* @author song.zheng@androidmov.com
*/
public class GsonUtil {
private GsonUtil() {
throw new AssertionError();
}

private static GsonBuilder getGsonBuilder() {
return new GsonBuilder().setPrettyPrinting();
}

public static <T> T jsonStr2Object(String jsonStr, TypeToken<T> typeToken) {
Gson gson = getGsonBuilder().create();
return gson.fromJson(jsonStr, typeToken.getType());
}

public static String object2JsonStr(Object object) {
Gson gson = getGsonBuilder().create();
return gson.toJson(object);
}

public static <T> T jsonStr2Object(String jsonStr, Class<T> clazz) {
Gson gson = getGsonBuilder().create();
return gson.fromJson(jsonStr, clazz);
}

public static <T> T[] jsonStr2Array(String jsonStr, Class<T[]> clazz) {
Gson gson = getGsonBuilder().create();
return gson.fromJson(jsonStr, clazz);
}

public static <T> List<T> jsonStr2List(String jsonStr, TypeToken<List<T>> typeToken) {
Gson gson = getGsonBuilder().create();
return gson.fromJson(jsonStr, typeToken.getType());
}

public static <T> Map<String, T> jsonStr2Map(String jsonStr, TypeToken<Map<String, T>>
typeToken) {
Gson gson = getGsonBuilder().create();
return gson.fromJson(jsonStr, typeToken.getType());
}

public static <T> void object2File(Object object, TypeToken<T> typeToken,
OutputStream outputStream) {
JsonWriter jsonWriter = new JsonWriter(new OutputStreamWriter(outputStream,
StandardCharsets.UTF_8));
Gson gson = getGsonBuilder().create();
gson.toJson(object, typeToken.getType(), jsonWriter);
try {
jsonWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}

public static <T> T file2Object(InputStream inputStream, TypeToken<T> typeToken) {
InputStreamReader inputStreamReader = new InputStreamReader(inputStream,
StandardCharsets.UTF_8);
Gson gson = new GsonBuilder().create();
T t = gson.fromJson(inputStreamReader, typeToken.getType());
try {
inputStreamReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return t;
}
public static String getJson(String fileName, Context context) {
//将json数据变成字符串
StringBuilder stringBuilder = new StringBuilder();
try {
//获取assets资源管理器
AssetManager assetManager = context.getAssets();
//通过管理器打开文件并读取
BufferedReader bf = new BufferedReader(new InputStreamReader(
assetManager.open(fileName)));
String line;
while ((line = bf.readLine()) != null) {
stringBuilder.append(line);
}
} catch (IOException e) {
e.printStackTrace();
}
return stringBuilder.toString();
}
}

+ 102
- 0
app/src/main/java/com/bonait/bnframework/common/model/UploadOrderInfo.java 查看文件

@@ -0,0 +1,102 @@
package com.bonait.bnframework.common.model;

import java.util.Date;
import java.util.List;

/**
* @author: liup
* @description:
* @date: 2024/11/27 13:36.
*/
public class UploadOrderInfo {
/// 是否设备订单
public boolean IsDevice;
/// 订单编号
public String OrderId ;
/// 订单编号
public int Number;

public int AutoKey;
public List<OrderDetail> OrderDetailList;

public static class OrderDetail
{
public String GoodsName;
public String AttributeName ;
/// 商品制作状态(0等待 1完成 2执行中 3异常 4取消)
public int Status;
public String UpdateTime ;

public String getGoodsName() {
return GoodsName;
}

public void setGoodsName(String goodsName) {
GoodsName = goodsName;
}

public String getAttributeName() {
return AttributeName;
}

public void setAttributeName(String attributeName) {
AttributeName = attributeName;
}

public int getStatus() {
return Status;
}

public void setStatus(int status) {
Status = status;
}

public String getUpdateTime() {
return UpdateTime;
}

public void setUpdateTime(String updateTime) {
UpdateTime = updateTime;
}
}

public boolean isDevice() {
return IsDevice;
}

public void setDevice(boolean device) {
IsDevice = device;
}

public String getOrderId() {
return OrderId;
}

public void setOrderId(String orderId) {
OrderId = orderId;
}

public int getNumber() {
return Number;
}

public void setNumber(int number) {
Number = number;
}

public int getAutoKey() {
return AutoKey;
}

public void setAutoKey(int autoKey) {
AutoKey = autoKey;
}

public List<OrderDetail> getOrderDetailList() {
return OrderDetailList;
}

public void setOrderDetailList(List<OrderDetail> orderDetailList) {
OrderDetailList = orderDetailList;
}
}

+ 20
- 0
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java 查看文件

@@ -26,6 +26,8 @@ import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.business.OrderServer;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET;
import com.bonait.bnframework.common.helper.I.IThread;
import com.bonait.bnframework.common.helper.MQTT;
import com.bonait.bnframework.common.helper.MediaPlayerHelper;
@@ -52,7 +54,9 @@ import com.bumptech.glide.Glide;
import com.qmuiteam.qmui.widget.QMUIViewPager;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import butterknife.BindView;
@@ -143,6 +147,22 @@ public class BottomNavigationMainActivity extends BaseActivity{
});*/


if(NetworkUtils.checkNetworkAvailable(this)){
ServerManager.btnUploadOrder(this,false);
}
initData();
}

private void initData(){
String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());

if(!PreferenceUtils.getString(ConfigName.SHARE_KEY_orderDate,"").equals(today)){
PreferenceUtils.setString(ConfigName.SHARE_KEY_orderDate,today);
ConfigName.getInstance().orderNum = 1;
BPA_SYSTEMSET set = QueryDB.GetSystemsetByType(5);
set.value = ConfigName.getInstance().orderNum+"";
QueryDB.UpdateSystemset(set);
}
}




+ 11
- 8
app/src/main/java/com/bonait/bnframework/modules/home/adapter/CloudOrderAdapter.java 查看文件

@@ -5,6 +5,8 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.db.res.ResOrderCloudList;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemCloudOrderBinding;
@@ -27,18 +29,14 @@ public abstract class CloudOrderAdapter extends BaseAdapter<ResOrderCloudList, C
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
ResOrderCloudList data = mData.get(position);
if(holder.binding.num.getWidth()==0){
if(holder.binding.num.getTextSize()>32||holder.binding.num.getTextSize()<28){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
}
holder.binding.sort.setText((position+1)+"");
if(data!=null){
holder.binding.date.setText(data.getDate());
holder.binding.num.setText(data.getNumId());
holder.binding.num.setText("#"+data.getNumId());
holder.binding.goodsNames.setText(data.getNames());
holder.binding.desc.setText(data.getDesc());
holder.binding.tvOrderId.setText(data.getOrderId());
}
holder.binding.sort.setText((position+1)+"");

holder.binding.delete.setOnClickListener(v->{
delete(v,position);
@@ -49,7 +47,12 @@ public abstract class CloudOrderAdapter extends BaseAdapter<ResOrderCloudList, C
holder.binding.look.setOnClickListener(v->{
onItemClick(v,position);
});

LogUtils.d("CloudOrderAdapter getHeight= "+holder.binding.getRoot().getHeight()+" size = "+holder.binding.sort.getTextSize());
if(holder.binding.getRoot().getHeight()==0){
if(holder.binding.sort.getTextSize()>34||holder.binding.sort.getTextSize()<26){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
}
}

public static class ViewHolder extends RecyclerView.ViewHolder {


+ 8
- 2
app/src/main/java/com/bonait/bnframework/modules/home/adapter/ddgl_adapter.java 查看文件

@@ -38,18 +38,24 @@ public class ddgl_adapter extends ArrayAdapter<ResSubOrder> {
//为每一个子项加载设定的布局
View view = LayoutInflater.from(getContext()).inflate(this.resource, parent, false);
//分别获取 image view 和 textview 的实例
TextView bh,time,name,status,bz;
TextView bh,time,name,status,bz,isDevice;
bh = (TextView) view.findViewById(R.id.bh);
time = (TextView) view.findViewById(R.id.time);
name = (TextView) view.findViewById(R.id.name);
status = (TextView) view.findViewById(R.id.status);
isDevice = (TextView) view.findViewById(R.id.isDevice);
bz = (TextView) view.findViewById(R.id.bz);
bh.setText(order.id);
bh.setText(order.orderID);
time.setText(order.createTime);
name.setText(order.goodsName);
time.setText(order.createTime);
status.setText(order.statusText);
bz.setText(order.exp);
if(order.isDevice.equals("false")){
isDevice.setText("云端");
}else {
isDevice.setText("设备");
}
switch (order.status)
{
case 0://未开始


+ 5
- 3
app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java 查看文件

@@ -12,6 +12,7 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -89,8 +90,9 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH
myViewHolder.loading_status.setText(goodsMake.makeStatus.name());
myViewHolder.loading_zuofa.setText(goodsMake.subOrder.exp);

DecimalFormat decimalFormat =new DecimalFormat("00");
myViewHolder.loading_xuhao.setText(decimalFormat.format(position+1));
// DecimalFormat decimalFormat =new DecimalFormat("00");
// myViewHolder.loading_xuhao.setText(decimalFormat.format(position+1));
myViewHolder.loading_xuhao.setText("#"+goodsMake.subOrder.numId);
// myViewHolder.loading_time.setText(new SimpleDateFormat("HH:mm:ss").format(Date.parse(goodsMake.subOrder.createTime)));
switch (goodsMake.makeStatus.name())
{
@@ -184,7 +186,7 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH
}

static class MyViewHolder extends RecyclerView.ViewHolder {
RelativeLayout loading_main;
LinearLayout loading_main;
ProgressBar loading_ProgressBar;
TextView loading_name;
TextView loading_zuofa;


+ 2
- 0
app/src/main/java/com/bonait/bnframework/modules/home/adapter/newgood_adapter.java 查看文件

@@ -82,6 +82,8 @@ public class newgood_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
if (!goods.url.equals("未知") && !goods.url.isEmpty() && !goods.url.equals("")) {
myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url);
// GlideUtil.showImageWithRadius(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3,10);
}else {
GlideUtil.showImageWithRadius(myViewHolder.ImageUrl.getContext(),R.mipmap.loading123,myViewHolder.ImageUrl,R.mipmap.loading3,10);
}

/**


+ 2
- 0
app/src/main/java/com/bonait/bnframework/modules/home/adapter/newmakegood_adapter.java 查看文件

@@ -74,6 +74,8 @@ public class newmakegood_adapter extends RecyclerView.Adapter<RecyclerView.View
myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url);
LogUtils.d(" ImageUrl == "+goods.url);
// GlideUtil.showImageWithRadius(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3,10);
}else {
GlideUtil.showImageWithRadius(myViewHolder.ImageUrl.getContext(),R.mipmap.loading123,myViewHolder.ImageUrl,R.mipmap.loading3,10);
}

/**


+ 61
- 8
app/src/main/java/com/bonait/bnframework/modules/home/fragment/CloudOrderFragment.java 查看文件

@@ -30,6 +30,7 @@ import com.bonait.bnframework.databinding.FragmentMakeOrderBinding;
import com.bonait.bnframework.event.FreshCloudOrderEvent;
import com.bonait.bnframework.modules.home.adapter.CloudOrderAdapter;
import com.bonait.bnframework.modules.home.fragment.mode.LookOrderGoodsDialog;
import com.bonait.bnframework.modules.home.util.WaitProcessUtil;
import com.mobsandgeeks.saripaar.annotation.Order;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
@@ -187,17 +188,16 @@ public class CloudOrderFragment extends BaseFragment {
bean.status = 4;
}
CloudGoodsUtil.update(bean);
BPA_SUBORDER suborder = QueryDB.GetSubOrderById(bean.id);
if(suborder==null){
BPA_SUBORDER suborder = QueryDB.GetSubOrderById(bean.orderId);
if(suborder!=null){
suborder.number = 1;
suborder.status = 4;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.UpdateSubOrder(suborder);
}else {
suborder = new BPA_SUBORDER();
suborder.orderID = bean.id;
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = bean.orderId;
suborder.goodsID = bean.GoodsId;
suborder.number = 1;
suborder.status = 4;
suborder.exp = bean.AttributeNames;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.AddSubOrder(suborder);
}
@@ -259,6 +259,59 @@ public class CloudOrderFragment extends BaseFragment {

}


public void deleteAll(){
String title = "温馨提示!";
String message = "确定删除所有系统订单吗?";
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
dialog.dismiss();
WaitProcessUtil.getInstance().show(getContext(),"正在删除订单","请耐心等待...");
try {
for(ResOrderCloudList orderCloudList : dataList){
BPA_ORDER_HEADER_CLOUD order = CloudOrderUtil.GetByOrderId(orderCloudList.getOrderId());
if(order!=null){
order.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
order.status = 2;
CloudOrderUtil.update(order);
}
for(BPA_ORDER_GOODS_CLOUD bean : orderCloudList.getGoodList()){
if(bean.status == 0){
bean.status = 4;
}
CloudGoodsUtil.update(bean);
BPA_SUBORDER suborder = QueryDB.GetSubOrderById(bean.orderId);
if(suborder!=null){
suborder.number = 1;
suborder.status = 4;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.UpdateSubOrder(suborder);
}else {
suborder = new BPA_SUBORDER();
suborder.number = 1;
suborder.status = 4;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.AddSubOrder(suborder);
}
}
}

}catch (Exception e){
ToastUtils.warning("删除订单异常" +e.getMessage());
}finally {
if(orderAdapter!=null){
initData();
orderAdapter.notifyDataSetChanged();
}
WaitProcessUtil.getInstance().dismiss();
}


}
});
}

private void test(){
List<BPA_ORDER_GOODS_CLOUD> list = new ArrayList<>();
List<BPA_ORDER_HEADER_CLOUD> orderList = new ArrayList<>();


+ 27
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MainTabFragment.java 查看文件

@@ -13,13 +13,25 @@ import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ExecuteTheRecipe;
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_ORDER_GOODS_CLOUD;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_HEADER_CLOUD;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.util.CloudGoodsUtil;
import com.bonait.bnframework.common.db.util.CloudOrderUtil;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.helper.MQTT;
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.FragmentMainTabBinding;
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;

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


@@ -32,6 +44,7 @@ public class MainTabFragment extends BaseFragment {

private FragmentMainTabBinding binding;
private boolean isResume;
private List<Fragment> fragmentList = new ArrayList<>();

@SuppressLint("HandlerLeak")
private Handler handler = new Handler() {
@@ -46,6 +59,8 @@ public class MainTabFragment extends BaseFragment {
removeMessages(0);
}
sendEmptyMessageDelayed(0,500);
binding.mqttStatus.setText(MQTT.get().IsConnect?"在线":"离线");
binding.plcStatus.setTextColor(ConfigName.getInstance().PlcIsConnect ? Color.parseColor("#4CAF50") : Color.parseColor("#D32F2F"));
break;
}
}
@@ -116,18 +131,29 @@ public class MainTabFragment extends BaseFragment {
});
binding.title1.setSelected(true);
binding.title2.setSelected(false);
binding.tvDelete.setText("手动订单");
binding.btnDeleteOrderList.setOnClickListener(v->{
if(binding.title1.isSelected()){
((MakeGoodFragment)fragmentList.get(0)).deleteAllOrder();
}else {
((CloudOrderFragment)fragmentList.get(1)).deleteAll();
}
});

binding.title1.setOnClickListener(v->{
binding.viewpager.setCurrentItem(0);
binding.title1.setSelected(true);
binding.title2.setSelected(false);
binding.tvDelete.setText("手动订单");
});
binding.title2.setOnClickListener(v->{
binding.viewpager.setCurrentItem(1);
binding.title2.setSelected(true);
binding.title1.setSelected(false);
binding.tvDelete.setText("系统订单");
});

List<Fragment> fragmentList = new ArrayList<>();
fragmentList = new ArrayList<>();
fragmentList.add(new MakeGoodFragment());
fragmentList.add(new CloudOrderFragment());
FragmentAdapter fragmentAdapter = new FragmentAdapter(getChildFragmentManager(),fragmentList);


+ 53
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java 查看文件

@@ -58,6 +58,7 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE;
import com.bonait.bnframework.common.db.mode.BPA_ORDER;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET;
import com.bonait.bnframework.common.db.res.AlertLogEnum;
import com.bonait.bnframework.common.db.res.ResGoodProperty;
import com.bonait.bnframework.common.db.res.ResGoodsMake;
@@ -70,6 +71,7 @@ import com.bonait.bnframework.common.helper.I.IRunT;
import com.bonait.bnframework.common.helper.I.IThread;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.helper.MediaPlayerHelper;
import com.bonait.bnframework.common.helper.MessageLog;
import com.bonait.bnframework.common.helper.ThreadManager;
import com.bonait.bnframework.common.helper.WrapContentLinearLayoutManager;
@@ -101,8 +103,11 @@ import org.w3c.dom.Text;

import java.lang.reflect.Method;
import java.security.PublicKey;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

@@ -303,6 +308,18 @@ public class MakeGoodFragment extends BaseFragment {
handler.sendEmptyMessageDelayed(0,200);
}

public void deleteAllOrder(){
String title = "温馨提示!";
String message = "确定删除所有手动订单吗?";
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
DataBus.getInstance().cancelAllGoodsMake();
dialog.dismiss();
}
});

}

/**
* 点击商品 开始制作
@@ -310,7 +327,27 @@ public class MakeGoodFragment extends BaseFragment {
public MyClickListener myClickListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {

ResGoodsMake makegood = (ResGoodsMake) data;

if(ConfigName.TEST){
String title = "温馨提示!";
String message = "客官确定要开始制作【" + makegood.good.name + "】吗?";
AlertDialogUtils.showDialog111(context, title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
DataBus.getInstance().DeleteGoodsMake(makegood.subOrder.id,false);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + makegood.good.name + "]-订单执行完成,请取餐!");
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_finish);
ToastUtils.info("测试模式-执行完成");
dialog.dismiss();
}
}).show();

return;
}


if (!ConfigName.getInstance().PlcIsConnect && !ConfigName.TEST2) {
ToastUtils.warning("设备已离线,请检查设备...");
return;
@@ -326,12 +363,12 @@ public class MakeGoodFragment extends BaseFragment {
return;
}

if (makegood.subOrder.status == 1) {
if (makegood.subOrder.status == 2) {
ToastUtils.warning("商品:" + makegood.good.name + ",已在制作中...");
return;
}

if (makegood.subOrder.status == 2) {
if (makegood.subOrder.status == 1) {
ToastUtils.warning("商品:" + makegood.good.name + ",已制作完成...");
return;
}
@@ -629,14 +666,27 @@ public class MakeGoodFragment extends BaseFragment {

for (int mm = 0; mm < num; mm++) {
BPA_SUBORDER suborder = new BPA_SUBORDER();
int orderNum = ConfigName.getInstance().orderNum;
String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
DecimalFormat decimalFormat =new DecimalFormat("0000");
suborder.orderID = ConfigName.getInstance().DeviceAutoKey+date.substring(2)+"1"+decimalFormat.format(orderNum);
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = order.id;
// suborder.orderID = order.id;
suborder.goodsID = good.id;
suborder.recipeID = goodsrecipename.id;
suborder.number = 1;
suborder.status = 0;
suborder.goodsName = good.name;
suborder.exp = names;

suborder.numId = orderNum+"";
orderNum++;
ConfigName.getInstance().orderNum = orderNum;
BPA_SYSTEMSET set = QueryDB.GetSystemsetByType(5);
set.value = ConfigName.getInstance().orderNum+"";
QueryDB.UpdateSystemset(set);

QueryDB.AddSubOrder(suborder);
DataBus.getInstance().AddGoodsMake(suborder);
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java 查看文件

@@ -485,7 +485,7 @@ public class GoodPeiFangActivity extends BaseActivity {

public boolean isFastClick(){
long curTime = System.currentTimeMillis();
if(curTime - lastTime < 1000){
if(curTime - lastTime < 500){
return true;
}
lastTime = curTime;


+ 27
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/LogActivity.java 查看文件

@@ -26,9 +26,16 @@ import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_ALERTLOG;
import com.bonait.bnframework.common.db.mode.BPA_LOG;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.res.ResAlertLog;
import com.bonait.bnframework.common.db.res.ResLog;
import com.bonait.bnframework.common.db.res.UserLogEnum;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.helper.MessageLog;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.KeyboardUtil;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.adapter.yjrz_adapter;
@@ -40,6 +47,8 @@ import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.QMUIViewPager;
import com.qmuiteam.qmui.widget.QMUIWindowInsetLayout;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;

import java.io.File;
@@ -234,15 +243,31 @@ public class LogActivity extends BaseActivity {
}

//region 点击事件
@OnClick({R.id.button,R.id.btn_upload})
@OnClick({R.id.button,R.id.btn_upload,R.id.delete})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.button://查询按钮
Initdata();
break;
case R.id.btn_upload://查询按钮
case R.id.btn_upload:
ServerManager.uploadDeviceLog(this,new File(ConfigName.getInstance().dbPath),true);
break;
case R.id.delete:
AlertDialogUtils.showDialog(this,
"删除提示!",
"客官确定要删除日志记录吗?",
new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
DBHelper.getInstance(LogActivity.this).DeleteCreateTables(BPA_LOG.class,null);
DBHelper.getInstance(LogActivity.this).DeleteCreateTables(BPA_ALERTLOG.class,null);
MessageLog.ShowUserMessage(UserLogEnum.角色操作日志,"删除日志记录");
Initdata();
dialog.dismiss();
}
});

break;
}
}
//endregion


+ 41
- 4
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/OrderListActivity.java 查看文件

@@ -20,19 +20,31 @@ import android.widget.Spinner;
import android.widget.TextView;

import com.bigkoo.pickerview.TimePickerView;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.R;
import com.bonait.bnframework.api.ServerManager;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_ALERTLOG;
import com.bonait.bnframework.common.db.mode.BPA_CLOUDDATA;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.res.ResSubOrder;
import com.bonait.bnframework.common.db.res.UserLogEnum;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.helper.MessageLog;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.KeyboardUtil;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.adapter.ddgl_adapter;
import com.bonait.bnframework.modules.home.fragment.DingDanfragment;
import com.bonait.bnframework.modules.home.fragment.GuanLifragment;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -62,6 +74,8 @@ public class OrderListActivity extends BaseActivity {
*/
@BindView(R.id.button)
Button button;
@BindView(R.id.btn_upload)
Button btn_upload;
/**
* 表格显示
*/
@@ -131,9 +145,10 @@ public class OrderListActivity extends BaseActivity {
//通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据
lx_map.put("全部",-1);
lx_map.put("未开始",0);
lx_map.put("制作中",1);
lx_map.put("已制作",2);
lx_map.put("已超时",3);
lx_map.put("已制作",1);
lx_map.put("制作中",2);
lx_map.put("异常",3);
lx_map.put("取消/删除",4);
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(lx_map.keySet()));
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item);
rzlx.setAdapter(adapter2);
@@ -218,12 +233,34 @@ public class OrderListActivity extends BaseActivity {

//region 点击事件

@OnClick({R.id.button})
@OnClick({R.id.button,R.id.btn_upload,R.id.delete})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.button://查询按钮
Initdata();
break;
case R.id.btn_upload://查询按钮
if(NetworkUtils.checkNetworkAvailable(this)){
ServerManager.btnUploadOrder(this,true);
}else {
ToastUtils.warning("请先连接网络!");
}
break;
case R.id.delete:
AlertDialogUtils.showDialog(this,
"删除提示!",
"客官确定要删除所有订单记录吗?",
new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
DBHelper.getInstance(OrderListActivity.this).DeleteCreateTables(BPA_SUBORDER.class,null);
MessageLog.ShowUserMessage(UserLogEnum.角色操作日志,"删除日志记录");
Initdata();
dialog.dismiss();
}
});

break;
}
}
//endregion


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SalesStatisticsActivity.java 查看文件

@@ -203,7 +203,7 @@ public class SalesStatisticsActivity extends BaseActivity {
if(order.goodsID.equals(item.id))
{
count++;
if(order.status==2)
if(order.status==1)
{
countyzz++;
}else if(order.status == 4){


+ 18
- 11
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SystemParameterActivity.java 查看文件

@@ -26,13 +26,19 @@ import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_CLOUDDATA;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.fragment.GuanLifragment;
import com.bonait.bnframework.modules.home.fragment.SheZhifragment;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.QMUIViewPager;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;

import java.util.ArrayList;
@@ -78,10 +84,7 @@ public class SystemParameterActivity extends BaseActivity {
super.handleMessage(msg);
}
};
/**
* 系统设置参数
*/
ArrayList<BPA_SYSTEMSET> bpa_systemsets = new ArrayList<>();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -135,8 +138,7 @@ public class SystemParameterActivity extends BaseActivity {
versionselection.setAdapter(adapter1);


bpa_systemsets = QueryDB.GetSystemsetALL();
for (BPA_SYSTEMSET item : bpa_systemsets) {
for (BPA_SYSTEMSET item : QueryDB.GetSystemsetALL()) {
try{
switch (item.type) {
case -100:
@@ -183,6 +185,7 @@ public class SystemParameterActivity extends BaseActivity {
@OnClick({R.id.StartButton,R.id.getKey})
public void onViewClicked(View view) {
switch (view.getId()) {

case R.id.getKey:
ThreadManager.get().execute(new Runnable() {
@Override
@@ -218,9 +221,8 @@ public class SystemParameterActivity extends BaseActivity {
isgb = true;
}

for (BPA_SYSTEMSET item : bpa_systemsets) {
QueryDB.DeleteSystemset(item.id);
}

DBHelper.getInstance(this).DeleteCreateTables(BPA_SYSTEMSET.class,null);

for (int i = 0; i < editTextLists.size(); i++) {
BPA_SYSTEMSET set = new BPA_SYSTEMSET();
@@ -243,6 +245,13 @@ public class SystemParameterActivity extends BaseActivity {
set_vis.deviceID = ConfigName.getInstance().DeviceId;
set_vis.userID = ConfigName.getInstance().user.userID;
QueryDB.AddSystemset(set_vis);

BPA_SYSTEMSET set_orderNum = new BPA_SYSTEMSET();
set_orderNum.type = 5;
set_orderNum.value = ConfigName.getInstance().orderNum+"";
set_orderNum.deviceID = ConfigName.getInstance().DeviceId;
set_orderNum.userID = ConfigName.getInstance().user.userID;
QueryDB.AddSystemset(set_orderNum);
if (isgb) {
ConfigData.getInstance().RevertPLCProcess();
}
@@ -264,8 +273,6 @@ public class SystemParameterActivity extends BaseActivity {
material_map = null;
material_map_vis.clear();
material_map_vis = null;
bpa_systemsets.clear();
bpa_systemsets = null;
context= null;
}



+ 1
- 33
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/CopyRecipeDialog.java 查看文件

@@ -209,7 +209,7 @@ public class CopyRecipeDialog extends DialogFragment {
@Override
public void onClick(View view) {
if(!DataBus.getInstance().doubleClick()) {
if (mListener != null && SaveData()) {
if (mListener != null ) {
mListener.onSubmit(goodsrecipename);
}
}
@@ -223,39 +223,7 @@ public class CopyRecipeDialog extends DialogFragment {
});
}

/**
* 保存数据
*/
private boolean SaveData() {
if (DataValidation()) {

BPA_ORDER order = new BPA_ORDER();
order.thirdPartyID = "手动下单";
order.status = 0;
order.deviceID = ConfigName.getInstance().DeviceId;
order.userID = ConfigName.getInstance().user.userID;
QueryDB.AddOrder(order);

BPA_SUBORDER suborder = new BPA_SUBORDER();
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = order.id;
suborder.goodsID = ((BPA_GOODS) Good).id;
suborder.recipeID=goodsrecipename.id;
suborder.number = 1;
suborder.status = 0;
suborder.exp=names;
QueryDB.AddSubOrder(suborder);

DataBus.getInstance().AddGoodsMake(suborder);
ToastUtils.info("商品:"+Good.name+",加入队列中...");
return true;
}else
{
ToastUtils.info("没有查询到配方,不能制作!");
return false;
}
}

BPA_GOODSRECIPENAME goodsrecipename = null;
String ggids = "";//规格id集合


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java 查看文件

@@ -474,7 +474,7 @@ public class GoodsEditView extends LinearLayout {

public boolean isFast2Click(){
long curTime = System.currentTimeMillis();
if(curTime - lastTime2 < 1000){
if(curTime - lastTime2 < 500){
return true;
}
lastTime2 = curTime;


+ 45
- 19
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LookOrderGoodsDialog.java 查看文件

@@ -43,6 +43,7 @@ import com.bonait.bnframework.common.db.res.UserLogEnum;
import com.bonait.bnframework.common.db.util.CloudGoodsUtil;
import com.bonait.bnframework.common.db.util.CloudOrderUtil;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.helper.MediaPlayerHelper;
import com.bonait.bnframework.common.helper.MessageLog;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
@@ -352,6 +353,7 @@ public class LookOrderGoodsDialog extends DialogFragment {
private void makeGoods(ArrayList<ResGoodsRecipe> recipes, String goodName, BPA_ORDER_GOODS_CLOUD orderCloud){
try {
if (ConfigName.TEST){
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_start);
orderCloud.status = 2;
CloudGoodsUtil.update(orderCloud);
handler.sendEmptyMessage(0);
@@ -359,9 +361,9 @@ public class LookOrderGoodsDialog extends DialogFragment {
orderCloud.status = 1;
CloudGoodsUtil.update(orderCloud);
handler.sendEmptyMessage(0);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + goodName + "]-订单执行完成,请取餐!");
addSubOrder(orderCloud,2);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + goodName + "]-出料完成,请取餐!");
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_finish);
addSubOrder(orderCloud,1);
return;
}
orderCloud.status = 2;
@@ -370,7 +372,7 @@ public class LookOrderGoodsDialog extends DialogFragment {
if(ExecuteTheRecipe.IsMakeGood && recipes!=null && !recipes.isEmpty())
{
LogUtils.d("商品制作线程 GoodMake = "+recipes.toString());
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_start);
//region 根据物料配方排序Sort步骤分组
LinkedHashMap<Integer, List<ResGoodsRecipe>> rgrs = new LinkedHashMap<>();
for (int i = 0; i < recipes.size(); i++) {
@@ -460,17 +462,19 @@ public class LookOrderGoodsDialog extends DialogFragment {
}

if(isError){
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + goodName + "]-订单执行失败!");
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + goodName + "]-执行失败!");
orderCloud.status = 3;
CloudGoodsUtil.update(orderCloud);
handler.sendEmptyMessage(0);
addSubOrder(orderCloud,3);
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_error);
}else {
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + goodName + "]-订单执行完成,请取餐!");
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + goodName + "]-出料完成,请取餐!");
orderCloud.status = 1;
CloudGoodsUtil.update(orderCloud);
handler.sendEmptyMessage(0);
addSubOrder(orderCloud,2);
addSubOrder(orderCloud,1);
MediaPlayerHelper.getInstance().PlaySound(R.raw.pl_finish);
}
}

@@ -497,17 +501,39 @@ public class LookOrderGoodsDialog extends DialogFragment {
void onClose(ResOrderCloudList orderBean);
}

private void addSubOrder( BPA_ORDER_GOODS_CLOUD orderCloud,int status){
BPA_SUBORDER suborder = new BPA_SUBORDER();
suborder.orderID = orderCloud.id;
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = orderCloud.orderId;
suborder.goodsID = orderCloud.GoodsId;
suborder.number = 1;
suborder.status = status;
suborder.exp = orderCloud.AttributeNames;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.AddSubOrder(suborder);
private void addSubOrder(BPA_ORDER_GOODS_CLOUD orderCloud,int status){
BPA_SUBORDER suborder = QueryDB.GetSubOrderId(orderCloud.id);
if(suborder!=null){
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = orderCloud.orderId;
suborder.isDevice = "false";
suborder.goodsID = orderCloud.GoodsId;
suborder.goodsName = orderCloud.GoodsName;
suborder.number = 1;
suborder.status = status;
suborder.isUpload = "false";
suborder.numId = orderCloud.numId;
suborder.exp = orderCloud.AttributeNames;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.UpdateSubOrder(suborder);
}else {
suborder = new BPA_SUBORDER();
suborder.id = orderCloud.id;
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = orderCloud.orderId;
suborder.isDevice = "false";
suborder.goodsID = orderCloud.GoodsId;
suborder.goodsName = orderCloud.GoodsName;
suborder.number = 1;
suborder.isUpload = "false";
suborder.status = status;
suborder.numId = orderCloud.numId;
suborder.exp = orderCloud.AttributeNames;
suborder.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
QueryDB.AddSubOrder(suborder);
}

}
}

+ 17
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_makegood_control.java 查看文件

@@ -27,19 +27,24 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_ORDER;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER;
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET;
import com.bonait.bnframework.common.db.res.ResGoodProperty;
import com.bonait.bnframework.common.db.res.ResGoodsRecipe;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.helper.WrapContentLinearLayoutManager;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.modules.home.adapter.newneatril_adapter;
import com.bonait.bnframework.modules.home.adapter.pfsx_adapter;
import com.bonait.bnframework.modules.home.adapter.xxpf_adapter;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import butterknife.BindView;
@@ -258,15 +263,26 @@ public class add_makegood_control extends LinearLayout{
order.userID = ConfigName.getInstance().user.userID;
QueryDB.AddOrder(order);

int orderNum = ConfigName.getInstance().orderNum;
BPA_SUBORDER suborder = new BPA_SUBORDER();
String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
DecimalFormat decimalFormat =new DecimalFormat("0000");
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = order.id;
suborder.orderID = ConfigName.getInstance().DeviceAutoKey+date.substring(2)+"1"+decimalFormat.format(orderNum);
suborder.goodsID = ((BPA_GOODS) Good).id;
suborder.recipeID=goodsrecipename.id;
suborder.number = 1;
suborder.status = 0;
suborder.numId = orderNum+"";
orderNum++;
ConfigName.getInstance().orderNum = orderNum;
BPA_SYSTEMSET set = QueryDB.GetSystemsetByType(5);
set.value = ConfigName.getInstance().orderNum+"";
QueryDB.UpdateSystemset(set);

suborder.exp=names;
suborder.goodsName=((BPA_GOODS) Good).name;
QueryDB.AddSubOrder(suborder);

DataBus.getInstance().AddGoodsMake(suborder);


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java 查看文件

@@ -53,7 +53,6 @@ import com.mobsandgeeks.saripaar.annotation.NotEmpty;
import com.mobsandgeeks.saripaar.annotation.Order;
import com.mobsandgeeks.saripaar.annotation.Password;
import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
import com.tencent.bugly.crashreport.CrashReport;

import org.litepal.LitePal;

@@ -124,6 +123,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL
*/
public void initData()
{
ConfigData.getInstance().LoadSystem();
mEtAccount.requestFocus();
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);



+ 18
- 0
app/src/main/res/drawable/bg_white_round_btn.xml 查看文件

@@ -0,0 +1,18 @@
<?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="10dp"/>
<solid android:color="#FF9800"/>
</shape>

</item>
<item>
<shape>
<corners android:radius="10dp"/>
<solid android:color="#ffffff"/>
</shape>

</item>
</selector>

+ 15
- 4
app/src/main/res/layout/activity_log.xml 查看文件

@@ -69,7 +69,10 @@
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textColor="@color/foreground"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="日志类型">
<requestFocus/>
</TextView>
<Spinner
android:id="@+id/rzlx"
@@ -98,8 +101,6 @@
android:layout_width="120dp"
android:layout_height="26dp"
android:textColor="@color/white"
android:focusableInTouchMode="true"
android:focusable="true"
/>

<Button
@@ -112,13 +113,23 @@
android:layout_width="60dp"
android:layout_height="26dp"
android:textColor="@color/white"
android:focusableInTouchMode="true"
android:focusable="true"
/>
</LinearLayout>

</RelativeLayout>

<Button
android:id="@+id/delete"
android:text="删除"
android:background="@drawable/bg_btn_login_selected"
android:textSize="@dimen/textSize"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_width="120dp"
android:layout_height="26dp"
android:textColor="@color/white"
/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">


+ 1
- 2
app/src/main/res/layout/activity_login.xml 查看文件

@@ -101,8 +101,7 @@
android:maxLines="1"
android:singleLine="true"
android:inputType="text"
android:focusable="true"
android:focusableInTouchMode="true"/>
/>

<ImageView
android:id="@+id/iv_clean_account"


+ 46
- 11
app/src/main/res/layout/activity_orderlist.xml 查看文件

@@ -92,23 +92,38 @@

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

</Button>

<Button
android:id="@+id/btn_upload"
android:layout_width="60dp"
android:layout_height="26dp"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:background="@drawable/bg_btn_login_selected"
android:text="上传"
android:textColor="@color/white"
android:textSize="@dimen/textSize" >

</Button>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="数量:"></TextView>
android:focusable="true"
android:focusableInTouchMode="true"
android:text="数量:">
<requestFocus/>
</TextView>
<TextView
android:id="@+id/count"
android:layout_width="wrap_content"
@@ -120,6 +135,17 @@

</RelativeLayout>

<Button
android:id="@+id/delete"
android:layout_width="100dp"
android:layout_height="26dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="@drawable/bg_btn_red_selected"
android:text="删除"
android:textColor="@color/white"
android:textSize="@dimen/textSize" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -158,7 +184,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="订单编号"
android:textAlignment="center"
android:textStyle="bold"
@@ -174,7 +199,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="创建时间"
android:textAlignment="center"
android:textStyle="bold"
@@ -190,7 +214,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="商品名称"
android:textAlignment="center"
android:textStyle="bold"
@@ -200,18 +223,31 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
android:layout_weight="0.7">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
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="0.7">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="来源"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
@@ -221,7 +257,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="备注"
android:textAlignment="center"
android:textStyle="bold"


+ 7
- 4
app/src/main/res/layout/activity_salesstatistics.xml 查看文件

@@ -75,10 +75,9 @@
android:background="@drawable/bg_btn_login_selected"
android:text="查询"
android:textColor="@color/white"
android:focusable="true"
android:focusableInTouchMode="true"

android:textSize="@dimen/textSize" >
<requestFocus/>
</Button>
</LinearLayout>
</RelativeLayout>
@@ -123,7 +122,11 @@
android:text="商品名称"
android:textAlignment="center"
android:textStyle="bold"
android:textColor="@color/white"/>
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/white">
<requestFocus/>
</TextView>
</RelativeLayout>

<RelativeLayout


+ 1
- 0
app/src/main/res/layout/activity_systemparameter.xml 查看文件

@@ -183,6 +183,7 @@


</RelativeLayout>

<RelativeLayout
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_40"


+ 21
- 8
app/src/main/res/layout/datatab/layout/ddgl_item.xml 查看文件

@@ -27,7 +27,7 @@
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"

android:layout_marginLeft="20dp"
android:text="订单编号"
android:textAlignment="center"
android:textColor="@color/black"
@@ -41,7 +41,7 @@
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"

@@ -58,7 +58,7 @@
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="商品名称"
android:layout_centerInParent="true"
@@ -69,21 +69,34 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_weight="0.7">
<TextView
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"

android:layout_centerInParent="true"

android:layout_alignParentLeft="true"
android:text="订单状态"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.7">
<TextView
android:id="@+id/isDevice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignParentLeft="true"
android:text="系统"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="30dp"
@@ -93,7 +106,7 @@
android:id="@+id/bz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="备注"
android:textAlignment="center"


+ 48
- 0
app/src/main/res/layout/fragment_main_tab.xml 查看文件

@@ -27,6 +27,36 @@
android:textColor="@drawable/color_text_tab"
/>

<LinearLayout
android:id="@+id/btn_delete_order_list"
android:layout_width="wrap_content"
android:layout_gravity="end"
android:layout_marginEnd="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_white_round_btn"
android:layout_height="40dp">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@mipmap/new_delete"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
/>
<TextView
android:id="@+id/tv_delete"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="系统订单"
android:gravity="center"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:textSize="26sp"
android:textColor="@color/gray"
android:layout_gravity="center_vertical"
/>
</LinearLayout>


<com.qmuiteam.qmui.widget.QMUIViewPager
android:id="@+id/viewpager"
android:layout_marginTop="60dp"
@@ -112,5 +142,23 @@
android:textSize="26sp" />


<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="end|center_vertical"
android:text="下单系统:"
android:textSize="26sp"
/>
<TextView
android:id="@+id/mqtt_status"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="end|center_vertical"
android:text="在线"
android:textSize="26sp"
android:textColor="@color/green_primary"
android:layout_marginEnd="20dp"
/>
</LinearLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 25
- 19
app/src/main/res/layout/fragment_make_good.xml 查看文件

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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"
@@ -70,29 +71,35 @@
android:paddingBottom="80dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

<LinearLayout
<RelativeLayout
android:id="@+id/loadgoodliebiao"
android:layout_alignParentRight="true"
android:layout_marginTop="3dp"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="match_parent">
<ImageView
android:id="@+id/loadgood"
android:layout_marginTop="10dp"
android:layout_marginTop="3dp"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@mipmap/ic_order"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/user"/>
<RelativeLayout
android:id="@+id/loadgoodliebiao"
android:layout_marginTop="@dimen/dp_10"
android:layout_height="25dp"
android:textSize="16sp"
android:text="订单列表"
android:layout_marginTop="3dp"
android:gravity="center_vertical"
android:layout_toEndOf="@id/loadgood"
android:layout_marginStart="5dp"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_below="@id/loadgood"
android:id="@+id/datatab_paiduishangping"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/datatab_paiduishangping"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_background"/>
</RelativeLayout>
</LinearLayout>
android:layout_height="match_parent"
android:background="@color/main_background"/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>

@@ -106,7 +113,6 @@
android:layout_height="match_parent"
android:visibility="gone"
android:clickable="true"
android:focusable="true"
/>
<com.bonait.bnframework.modules.home.fragment.mode.add_manguan_control
android:id="@+id/add_manguan"


+ 0
- 1
app/src/main/res/layout/fragment_make_order.xml 查看文件

@@ -8,7 +8,6 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical"
android:layout_width="match_parent"


+ 0
- 1
app/src/main/res/layout/item/layout/dialog_add_pf.xml 查看文件

@@ -4,7 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dialogbj"
android:focusable="true"
android:clickable="true">

<RelativeLayout


+ 0
- 1
app/src/main/res/layout/item/layout/dialog_add_pf_home.xml 查看文件

@@ -4,7 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dialogbj"
android:focusable="true"
android:clickable="true">

<RelativeLayout


+ 0
- 1
app/src/main/res/layout/item/layout/dialog_add_silos_ck.xml 查看文件

@@ -189,7 +189,6 @@
android:id="@+id/control_switch"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:focusable="true"
/>
</LinearLayout>
<LinearLayout


+ 1
- 1
app/src/main/res/layout/item/layout/fragment_item_plc_control.xml 查看文件

@@ -99,7 +99,7 @@
android:id="@+id/control_switch"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:focusable="true">
>

</com.suke.widget.SwitchButton>
<!-- <Switch-->


+ 127
- 105
app/src/main/res/layout/item/layout/item_cloud_order.xml 查看文件

@@ -1,126 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/item_bg_round_white"
tools:layout_width="1208dp"
android:layout_height="110dp">
android:layout_height="wrap_content">

<TextView
android:id="@+id/sort"
android:layout_width="90dp"
android:layout_height="match_parent"
android:background="@drawable/item_bg_left_round_blue"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="1"
android:gravity="center"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="140dp">

<TextView
android:id="@+id/num"
android:layout_width="100dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="0567"
android:gravity="center"
/>
<TextView
android:id="@+id/sort"
android:layout_width="90dp"
android:layout_height="match_parent"
android:background="@drawable/item_bg_left_round_blue"
android:gravity="center"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="1" />

<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>
<TextView
android:id="@+id/num"
android:layout_width="100dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="0567"
android:gravity="center"
/>

<TextView
android:id="@+id/date"
android:layout_width="180dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="202411-20 15:39:23"
android:gravity="center"
/>
<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>

<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>
<TextView
android:id="@+id/date"
android:layout_width="180dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="202411-20 15:39:23"
android:gravity="center"
/>

<TextView
android:id="@+id/goods_names"
android:layout_width="350dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="抄手*2,面条,干拌面,牛肉面,火鸡面*3,螺...鸡面*3,螺..."
android:gravity="center"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:maxLines="2"
android:ellipsize="end"
/>
<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>
<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>

<TextView
android:id="@+id/desc"
android:layout_width="120dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="0/8"
android:gravity="center"
/>
<TextView
android:id="@+id/goods_names"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="抄手*2,面条,干拌面,牛肉面,火鸡面*3,螺...鸡面*3,螺..."
android:gravity="center"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:maxLines="2"
android:ellipsize="end"
/>
<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>

<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>
<TextView
android:id="@+id/desc"
android:layout_width="130dp"
android:layout_height="match_parent"
android:textColor="@color/black"
android:textSize="30sp"
tools:text="0/8"
android:gravity="center"
/>

<Button
android:id="@+id/delete"
android:layout_width="120dp"
android:layout_height="70dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="20dp"
android:background="@drawable/bg_red_round20_btn"
android:gravity="center"
android:text="删除"
android:textSize="30sp"
android:textColor="@color/white"
/>
<TextView
android:layout_width="1dp"
android:layout_height="75dp"
android:textSize="30sp"
android:layout_gravity="center_vertical"
android:background="#33000000"
/>

<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="end"
android:layout_height="match_parent">
<Button
android:id="@+id/delete"
android:layout_width="120dp"
android:layout_height="70dp"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="20dp"
android:background="@drawable/bg_red_round20_btn"
android:gravity="center"
android:text="删除"
android:textSize="30sp"
android:textColor="@color/white"
/>

<Button
android:id="@+id/look"
android:layout_width="120dp"
android:layout_height="70dp"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="20dp"
android:background="@drawable/bg_blue_round20_btn"
android:gravity="center"
android:text="查看"
android:layout_marginEnd="20dp"
android:textSize="30sp"
android:textColor="@color/white"
/>
</LinearLayout>
</LinearLayout>

<Button
android:id="@+id/look"
android:layout_width="120dp"
android:layout_height="70dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="20dp"
android:background="@drawable/bg_blue_round20_btn"

<TextView
android:id="@+id/tv_orderId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/gray"
android:textSize="24sp"
tools:text="1234567891012"
android:gravity="center"
android:text="查看"
android:textSize="30sp"
android:textColor="@color/white"
android:layout_marginStart="90dp"
/>

</LinearLayout>
</FrameLayout>

+ 5
- 2
app/src/main/res/layout/item/layout/item_right_lc.xml 查看文件

@@ -9,15 +9,18 @@
<!-- android:layout_height="match_parent">-->
<!-- -->
<!-- </ScrollView>-->

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<TextView
android:layout_marginTop="7dp"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_height="5dp"
android:background="@color/app_color_blue7f"
/>
<TextView
android:layout_width="1dp"
android:layout_height="15dp"/>
</LinearLayout>

+ 54
- 69
app/src/main/res/layout/item/layout/loadinggood_item.xml 查看文件

@@ -2,77 +2,60 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="100dp"
android:orientation="horizontal"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.android.com/apk/res/android ">
>

<RelativeLayout
<ProgressBar
android:id="@+id/loading_ProgressBar"
style="@style/ProgressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:max="100"
android:progress="0" />
<LinearLayout
android:id="@+id/loading_main"
android:layout_width="match_parent"
android:layout_height="100dp">
android:layout_height="match_parent">
<TextView
android:id="@+id/loading_xuhao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_gravity="center_vertical"
android:textSize="16sp"
android:text="01"/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/loading_ProgressBar"
style="@style/ProgressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:max="100"
android:progress="0" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">

<TextView
android:id="@+id/loading_xuhao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="10dp"
android:textSize="16sp"
android:text="01"></TextView>
</RelativeLayout>

<RelativeLayout
android:layout_marginRight="100dp"
android:layout_centerInParent="true"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/loading_name"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/loading_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="金牡丹菠萝奶茶茶饮"
android:textAlignment="center"
android:textSize="16sp"
/>
android:layout_height="wrap_content"
android:text="金牡丹菠萝奶茶茶饮"
android:textAlignment="center"
android:textSize="16sp"
/>

<TextView
android:id="@+id/loading_zuofa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="中杯/去冰/无糖"
android:textSize="16sp"
android:textAlignment="center" />
<TextView
android:visibility="gone"
android:id="@+id/loading_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00:00:00"/>
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/loading_zuofa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="中杯/去冰/无糖"
android:textSize="16sp"
android:textAlignment="center" />
<TextView
android:visibility="gone"
android:id="@+id/loading_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00:00:00"/>
</LinearLayout>

<RelativeLayout
@@ -103,10 +86,12 @@
android:textColor="@color/white"
/>
</RelativeLayout>
<RelativeLayout
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/black_50p"/>
</RelativeLayout>
</LinearLayout>


<RelativeLayout
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/black_50p"/>
</RelativeLayout>

+ 0
- 3
app/src/main/res/layout/item/layout/silos_jiaoyan_item.xml 查看文件

@@ -4,7 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:background="@color/black">

<RelativeLayout
@@ -647,7 +646,6 @@
</LinearLayout>

<RelativeLayout
android:focusable="true"
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -717,7 +715,6 @@
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:focusable="true"
app:sb_button_color="@color/app_color_blue"
app:sb_uncheck_color="@color/app_color_blue"
app:sb_uncheckcircle_color="@color/app_color_blue" />


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


Loading…
取消
儲存