From a46dda631c5cb7097d08954a21889b6739d483c1 Mon Sep 17 00:00:00 2001
From: liup <1454939542@qq.com>
Date: Thu, 19 Sep 2024 11:35:19 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93?=
=?UTF-8?q?=E5=9C=B0=E5=9D=80=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=AD=BE=E5=90=8D?=
=?UTF-8?q?=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
.idea/easycode/codebase-v2.xml | 6 +++
app/build.gradle | 8 ++++
app/release/output-metadata.json | 20 +++++++++
.../bonait/bnframework/business/MainInit.java | 11 -----
.../common/constant/ConfigName.java | 20 +++++----
.../common/db/mode/BPA_MATERIAL.java | 10 +++++
.../bnframework/common/helper/SdCart.java | 12 +++++-
.../common/model/upload/MaterialDataInfo.java | 11 ++++-
.../fragment/SystemSystemsetFragment.java | 6 +--
.../ui/viewmodel/HomeGoodsViewModel.java | 6 ++-
.../ui/viewmodel/UpdateDataService.java | 40 ++++++++++++++++++
keystore.jks | Bin 0 -> 2626 bytes
13 files changed, 122 insertions(+), 29 deletions(-)
create mode 100644 .idea/easycode/codebase-v2.xml
create mode 100644 app/release/output-metadata.json
create mode 100644 keystore.jks
diff --git a/.gitignore b/.gitignore
index 2b75303a..2a0d26c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@
/build
/captures
.externalNativeBuild
+*.apk
diff --git a/.idea/easycode/codebase-v2.xml b/.idea/easycode/codebase-v2.xml
new file mode 100644
index 00000000..a55bfca6
--- /dev/null
+++ b/.idea/easycode/codebase-v2.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 99320ca6..ca53089b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -20,6 +20,14 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled true
}
+ signingConfigs {
+ release {
+ storeFile file('D:/AndroidStudioGit/500chaoguo/keystore.jks')
+ storePassword "123456"
+ keyAlias "hbl"
+ keyPassword "123456"
+ }
+ }
buildTypes {
release {
minifyEnabled false
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
new file mode 100644
index 00000000..23df96c4
--- /dev/null
+++ b/app/release/output-metadata.json
@@ -0,0 +1,20 @@
+{
+ "version": 3,
+ "artifactType": {
+ "type": "APK",
+ "kind": "Directory"
+ },
+ "applicationId": "com.bonait.bnframework.newchaoguo2",
+ "variantName": "release",
+ "elements": [
+ {
+ "type": "SINGLE",
+ "filters": [],
+ "attributes": [],
+ "versionCode": 105,
+ "versionName": "1.0.5",
+ "outputFile": "boluo-xiaochao-v105-202409191128-unsigned-release.apk"
+ }
+ ],
+ "elementType": "File"
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/bonait/bnframework/business/MainInit.java b/app/src/main/java/com/bonait/bnframework/business/MainInit.java
index d70309d4..d21c3b6d 100644
--- a/app/src/main/java/com/bonait/bnframework/business/MainInit.java
+++ b/app/src/main/java/com/bonait/bnframework/business/MainInit.java
@@ -284,17 +284,6 @@ public class MainInit {
{
ConfigData.getInstance().RevertPLCProcess();
}
-
- if(PreferenceUtils.getInt("isNewVersion",0)!=3){
- if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_PROPERTY_CLASSIFY.class)){
- DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_PROPERTY_CLASSIFY.class,null);
- }
- if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_MATERIAL_TYPE.class)){
- DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_MATERIAL_TYPE.class,null);
- }
- DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_GOODS.class,null);
- PreferenceUtils.setInt("isNewVersion",3);
- }
}
diff --git a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
index b95fdfb1..b255eee9 100644
--- a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
+++ b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
@@ -2,9 +2,8 @@ package com.bonait.bnframework.common.constant;
import android.app.Application;
import android.content.Context;
-import android.os.Environment;
import android.widget.Switch;
-
+import android.os.Environment;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
import com.bonait.bnframework.common.db.mode.BPA_USER;
@@ -2177,13 +2176,18 @@ public class ConfigName {
//endregion
public static String getFileRoot(Context context) {
- if (android.os.Environment.getExternalStorageState().equals(
- android.os.Environment.MEDIA_MOUNTED)) {
- File external = context.getExternalFilesDir(null);
- if (external != null) {
- return external.getAbsolutePath();
+ if(mInstance.isPhoneVersion){
+ if (android.os.Environment.getExternalStorageState().equals(
+ android.os.Environment.MEDIA_MOUNTED)) {
+ File external = context.getExternalFilesDir(null);
+ if (external != null) {
+ return external.getAbsolutePath();
+ }
}
+ return context.getFilesDir().getAbsolutePath();
+ }else {
+
+ return android.os.Environment.getExternalStorageDirectory().getAbsolutePath();
}
- return context.getFilesDir().getAbsolutePath();
}
}
diff --git a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_MATERIAL.java b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_MATERIAL.java
index bf3a62fe..4909535f 100644
--- a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_MATERIAL.java
+++ b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_MATERIAL.java
@@ -19,4 +19,14 @@ public class BPA_MATERIAL extends ModeBase {
// public String uintId;
// public String uintName;
+
+ @Override
+ public String toString() {
+ return "BPA_MATERIAL{" +
+ "type=" + type +
+ ", name='" + name + '\'' +
+ ", imgUrl='" + imgUrl + '\'' +
+ ", id='" + id + '\'' +
+ '}';
+ }
}
diff --git a/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java b/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java
index c090ace6..b1f00c0e 100644
--- a/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java
+++ b/app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java
@@ -50,7 +50,17 @@ public class SdCart {
*/
public void initSD() {
- ConfigName.getInstance().sdCardPath = ConfigName.getFileRoot(MainApplication.getContext());
+ if(ConfigName.getInstance().isPhoneVersion){
+ ConfigName.getInstance().sdCardPath = ConfigName.getFileRoot(MainApplication.getContext());
+ }else {
+ File sdDir = null;
+ boolean sdCardExist = android.os.Environment.getExternalStorageState().equals(
+ android.os.Environment.MEDIA_MOUNTED);
+ if (sdCardExist) {
+ sdDir = android.os.Environment.getExternalStorageDirectory();
+ ConfigName.getInstance().sdCardPath = sdDir.toString();
+ }
+ }
ConfigName.getInstance().appResRoot = ConfigName.getInstance().sdCardPath +ConfigName.dataPath;
ConfigName.getInstance().dbPath = ConfigName.getInstance().appResRoot + "/hbl.db";
diff --git a/app/src/main/java/com/bonait/bnframework/common/model/upload/MaterialDataInfo.java b/app/src/main/java/com/bonait/bnframework/common/model/upload/MaterialDataInfo.java
index 96ab4bfb..6707ede6 100644
--- a/app/src/main/java/com/bonait/bnframework/common/model/upload/MaterialDataInfo.java
+++ b/app/src/main/java/com/bonait/bnframework/common/model/upload/MaterialDataInfo.java
@@ -18,6 +18,13 @@ public class MaterialDataInfo {
this.typeId = typeId;
}
-
-
+ @Override
+ public String toString() {
+ return "MaterialDataInfo{" +
+ "id='" + id + '\'' +
+ ", name='" + name + '\'' +
+ ", typeId='" + typeId + '\'' +
+ ", typeName='" + typeName + '\'' +
+ '}';
+ }
}
diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java
index b9305d2b..25b65608 100644
--- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java
+++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java
@@ -147,10 +147,6 @@ public class SystemSystemsetFragment extends BaseFragment {
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
- if(isVisibleToUser){
- cb_autoInit.setChecked(ConfigName.getInstance().IsAutoInit);
- cb_autoSilos.setChecked(ConfigName.getInstance().silosAuto);
- }
}
private void initData() {
@@ -300,7 +296,7 @@ public class SystemSystemsetFragment extends BaseFragment {
switch (view.getId()) {
case R.id.btn_update_key:
ThreadManager.get().execute(new Thread(()->{
- HomeGoodsViewModel.GetServiceKey(new HomeGoodsViewModel.CallBack() {
+ HomeGoodsViewModel.GetServiceKey(edittext4.getText().toString(),new HomeGoodsViewModel.CallBack() {
@Override
public void success() {
if(edittext103!=null){
diff --git a/app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java b/app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java
index 50113548..ddebbd11 100644
--- a/app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java
+++ b/app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java
@@ -133,9 +133,11 @@ public class HomeGoodsViewModel extends ViewModel {
/**
* 获取平台授权码
*/
- public static void GetServiceKey(CallBack listener){
+ public static void GetServiceKey(String key,CallBack listener){
String url = UpdateDataService.path+"/api/check/auth-key/"+ConfigName.getInstance().DeviceAutoKey;
-// String url = "http://192.168.1.50:5006/api/check/auth-key/279";
+ if(!key.isEmpty()){
+ url = UpdateDataService.path+"/api/check/auth-key/"+key;
+ }
LogUtils.d("GetServiceKey url="+url);
RecordManager.getInstance().addLogRecord("数据接收", "获取平台授权码-"+url);
APIHelper.get(url,null,new TypeReference>(){}).OnSource(s->{
diff --git a/app/src/main/java/com/bonait/bnframework/ui/viewmodel/UpdateDataService.java b/app/src/main/java/com/bonait/bnframework/ui/viewmodel/UpdateDataService.java
index 27871286..fae9b393 100644
--- a/app/src/main/java/com/bonait/bnframework/ui/viewmodel/UpdateDataService.java
+++ b/app/src/main/java/com/bonait/bnframework/ui/viewmodel/UpdateDataService.java
@@ -3,11 +3,15 @@ package com.bonait.bnframework.ui.viewmodel;
import android.content.Context;
import android.os.Environment;
+import com.alibaba.fastjson.TypeReference;
import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.business.RecordManager;
+import com.bonait.bnframework.common.API.APIHelper;
+import com.bonait.bnframework.common.API.APIResultT;
import com.bonait.bnframework.common.Result.OperateResult;
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_ATTRIBUTE;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
@@ -19,6 +23,7 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_PROCESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel;
+import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_SUBATTRIBUTE;
import com.bonait.bnframework.common.db.util.AttributeDBUtil;
import com.bonait.bnframework.common.db.util.GoodsClassifyDBUtil;
@@ -31,6 +36,9 @@ import com.bonait.bnframework.common.db.util.SubAttributeDBUtil;
import com.bonait.bnframework.common.db.util.SubAttributeGroupDBUtil;
import com.bonait.bnframework.common.helper.I.IRunT;
import com.bonait.bnframework.common.http.callback.json.JsonDialogCallback;
+import com.bonait.bnframework.common.model.MaterialData;
+import com.bonait.bnframework.common.model.MaterialRequestPar;
+import com.bonait.bnframework.common.model.MaterialTypeData;
import com.bonait.bnframework.common.model.upload.ProcessModelBean;
import com.bonait.bnframework.common.model.upload.GoodsDataInfo;
import com.bonait.bnframework.common.model.upload.GoodsProcessDetail;
@@ -271,9 +279,41 @@ public class UpdateDataService {
* @param goodsId
* @param context
*/
+// private static void upLoadMaterial(String goodsId,Context context,List upMaterialBean){
+// try{
+//
+// String url = UpdateDataService.path+"/api/ExternalPlatform/Material/GetMaterialPageList";//saasbase
+// LogUtils.d("GetMaterialInfo url="+url+" UpdateDataService.key="+UpdateDataService.key);
+// String key =UpdateDataService.key;
+// RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息-"+url);
+// APIHelper.PostT(url,new MaterialRequestPar(1,100),key,new TypeReference>(){}).OnSource(s->{
+// RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息成功");
+// List datas = new ArrayList<>();
+// List ids = new ArrayList<>();
+// LogUtils.d(" urlGetMaterial s.Content.data="+s.Content.data.toString());
+// for(int i = 0;i upMaterialBean){
try{
WaitProcessUtil.getInstance().Show("正在上传物料信息,请耐心稍等...","Material information is in progress, please be patient and wait for a moment");
+
List materials = MaterialUtil.GetMaterialALL();
if(upMaterialBean==null){
upMaterialBean = new ArrayList<>();
diff --git a/keystore.jks b/keystore.jks
new file mode 100644
index 0000000000000000000000000000000000000000..226d727fd364232a867a7363296820b3020c17e4
GIT binary patch
literal 2626
zcma);c{CLK8pjzk!@gED88l&(rG;VeW*_^$MfM1h
zED0G6VsIPb5-R&}yXW3h=l*r?AHVaQ=kq+@=g-giAxYeN0Co-}3GxLDQH(K<+2LX5
zWT%oKbRY>b@e_|CNubjI8iCS*Bv9&4ob>ZO1w;Rnf^oA0s3efVPk0{b^(z75L86i8
zez!2>pFqJM!McejpU|drLA1-`SQ&Gnw=^#RKmiV5mqEh7T>riZfPmPLl3<8yj5)g}
z2asJ62)8JHyT+1Ful=UOKx4qL;G9TTX#M?gPeGI(se9JulEs_;%4WlUWUKmt(Q4Z
zNWGoCHs_}n{t;X4V0w2Y+^|UD44rH8TvKY2+5qA0RP=4~DBn~y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