Browse Source

修改数据库地址,添加签名文件

授权码生成工具
liup 3 months ago
parent
commit
a46dda631c
13 changed files with 122 additions and 29 deletions
  1. +1
    -0
      .gitignore
  2. +6
    -0
      .idea/easycode/codebase-v2.xml
  3. +8
    -0
      app/build.gradle
  4. +20
    -0
      app/release/output-metadata.json
  5. +0
    -11
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  6. +12
    -8
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  7. +10
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_MATERIAL.java
  8. +11
    -1
      app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java
  9. +9
    -2
      app/src/main/java/com/bonait/bnframework/common/model/upload/MaterialDataInfo.java
  10. +1
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java
  11. +4
    -2
      app/src/main/java/com/bonait/bnframework/ui/viewmodel/HomeGoodsViewModel.java
  12. +40
    -0
      app/src/main/java/com/bonait/bnframework/ui/viewmodel/UpdateDataService.java
  13. BIN
     

+ 1
- 0
.gitignore View File

@@ -11,3 +11,4 @@
/build
/captures
.externalNativeBuild
*.apk

+ 6
- 0
.idea/easycode/codebase-v2.xml
File diff suppressed because it is too large
View File


+ 8
- 0
app/build.gradle View File

@@ -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


+ 20
- 0
app/release/output-metadata.json View File

@@ -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"
}

+ 0
- 11
app/src/main/java/com/bonait/bnframework/business/MainInit.java View File

@@ -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);
}
}




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

@@ -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();
}
}

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

@@ -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 + '\'' +
'}';
}
}

+ 11
- 1
app/src/main/java/com/bonait/bnframework/common/helper/SdCart.java View File

@@ -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";


+ 9
- 2
app/src/main/java/com/bonait/bnframework/common/model/upload/MaterialDataInfo.java View File

@@ -18,6 +18,13 @@ public class MaterialDataInfo {
this.typeId = typeId;
}



@Override
public String toString() {
return "MaterialDataInfo{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", typeId='" + typeId + '\'' +
", typeName='" + typeName + '\'' +
'}';
}
}

+ 1
- 5
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemSystemsetFragment.java View File

@@ -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){


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

@@ -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<APIResultT<String>>(){}).OnSource(s->{


+ 40
- 0
app/src/main/java/com/bonait/bnframework/ui/viewmodel/UpdateDataService.java View File

@@ -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<MaterialDataInfo> 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<APIResultT<MaterialData>>(){}).OnSource(s->{
// RecordManager.getInstance().addLogRecord("数据接收", "接收物料信息成功");
// List<BPA_MATERIAL> datas = new ArrayList<>();
// List<String> ids = new ArrayList<>();
// LogUtils.d(" urlGetMaterial s.Content.data="+s.Content.data.toString());
// for(int i = 0;i<s.Content.data.size();i++){
// ids.add(s.Content.data.get(i).id);
// }
// for(BPA_MATERIAL bean : MaterialUtil.GetMaterialALL()){
// if(!ids.contains(bean.id)){
// datas.add(bean);
// }
// }
//
// LogUtils.d(" urlGetMaterial deal datas="+datas.toString());
// upLoadMaterial2(goodsId,context,datas,upMaterialBean);
// });
//
// }catch (Exception e){
// LogUtils.d("网络请求异常"+e.getMessage());
// }
//
// }

private static void upLoadMaterial(String goodsId,Context context,List<MaterialDataInfo> upMaterialBean){
try{
WaitProcessUtil.getInstance().Show("正在上传物料信息,请耐心稍等...","Material information is in progress, please be patient and wait for a moment");

List<BPA_MATERIAL> materials = MaterialUtil.GetMaterialALL();
if(upMaterialBean==null){
upMaterialBean = new ArrayList<>();


BIN
View File


Loading…
Cancel
Save