@@ -11,3 +11,4 @@ | |||||
/build | /build | ||||
/captures | /captures | ||||
.externalNativeBuild | .externalNativeBuild | ||||
*.apk |
@@ -20,6 +20,14 @@ android { | |||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | ||||
multiDexEnabled true | multiDexEnabled true | ||||
} | } | ||||
signingConfigs { | |||||
release { | |||||
storeFile file('D:/AndroidStudioGit/500chaoguo/keystore.jks') | |||||
storePassword "123456" | |||||
keyAlias "hbl" | |||||
keyPassword "123456" | |||||
} | |||||
} | |||||
buildTypes { | buildTypes { | ||||
release { | release { | ||||
minifyEnabled false | minifyEnabled false | ||||
@@ -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" | |||||
} |
@@ -284,17 +284,6 @@ public class MainInit { | |||||
{ | { | ||||
ConfigData.getInstance().RevertPLCProcess(); | 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); | |||||
} | |||||
} | } | ||||
@@ -2,9 +2,8 @@ package com.bonait.bnframework.common.constant; | |||||
import android.app.Application; | import android.app.Application; | ||||
import android.content.Context; | import android.content.Context; | ||||
import android.os.Environment; | |||||
import android.widget.Switch; | import android.widget.Switch; | ||||
import android.os.Environment; | |||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | ||||
import com.bonait.bnframework.common.db.mode.BPA_USER; | import com.bonait.bnframework.common.db.mode.BPA_USER; | ||||
@@ -2177,13 +2176,18 @@ public class ConfigName { | |||||
//endregion | //endregion | ||||
public static String getFileRoot(Context context) { | 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(); | |||||
} | } | ||||
} | } |
@@ -19,4 +19,14 @@ public class BPA_MATERIAL extends ModeBase { | |||||
// public String uintId; | // public String uintId; | ||||
// public String uintName; | // public String uintName; | ||||
@Override | |||||
public String toString() { | |||||
return "BPA_MATERIAL{" + | |||||
"type=" + type + | |||||
", name='" + name + '\'' + | |||||
", imgUrl='" + imgUrl + '\'' + | |||||
", id='" + id + '\'' + | |||||
'}'; | |||||
} | |||||
} | } |
@@ -50,7 +50,17 @@ public class SdCart { | |||||
*/ | */ | ||||
public void initSD() { | 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().appResRoot = ConfigName.getInstance().sdCardPath +ConfigName.dataPath; | ||||
ConfigName.getInstance().dbPath = ConfigName.getInstance().appResRoot + "/hbl.db"; | ConfigName.getInstance().dbPath = ConfigName.getInstance().appResRoot + "/hbl.db"; | ||||
@@ -18,6 +18,13 @@ public class MaterialDataInfo { | |||||
this.typeId = typeId; | this.typeId = typeId; | ||||
} | } | ||||
@Override | |||||
public String toString() { | |||||
return "MaterialDataInfo{" + | |||||
"id='" + id + '\'' + | |||||
", name='" + name + '\'' + | |||||
", typeId='" + typeId + '\'' + | |||||
", typeName='" + typeName + '\'' + | |||||
'}'; | |||||
} | |||||
} | } |
@@ -147,10 +147,6 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
@Override | @Override | ||||
public void setUserVisibleHint(boolean isVisibleToUser) { | public void setUserVisibleHint(boolean isVisibleToUser) { | ||||
super.setUserVisibleHint(isVisibleToUser); | super.setUserVisibleHint(isVisibleToUser); | ||||
if(isVisibleToUser){ | |||||
cb_autoInit.setChecked(ConfigName.getInstance().IsAutoInit); | |||||
cb_autoSilos.setChecked(ConfigName.getInstance().silosAuto); | |||||
} | |||||
} | } | ||||
private void initData() { | private void initData() { | ||||
@@ -300,7 +296,7 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
switch (view.getId()) { | switch (view.getId()) { | ||||
case R.id.btn_update_key: | case R.id.btn_update_key: | ||||
ThreadManager.get().execute(new Thread(()->{ | ThreadManager.get().execute(new Thread(()->{ | ||||
HomeGoodsViewModel.GetServiceKey(new HomeGoodsViewModel.CallBack() { | |||||
HomeGoodsViewModel.GetServiceKey(edittext4.getText().toString(),new HomeGoodsViewModel.CallBack() { | |||||
@Override | @Override | ||||
public void success() { | public void success() { | ||||
if(edittext103!=null){ | if(edittext103!=null){ | ||||
@@ -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 = 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); | LogUtils.d("GetServiceKey url="+url); | ||||
RecordManager.getInstance().addLogRecord("数据接收", "获取平台授权码-"+url); | RecordManager.getInstance().addLogRecord("数据接收", "获取平台授权码-"+url); | ||||
APIHelper.get(url,null,new TypeReference<APIResultT<String>>(){}).OnSource(s->{ | APIHelper.get(url,null,new TypeReference<APIResultT<String>>(){}).OnSource(s->{ | ||||
@@ -3,11 +3,15 @@ package com.bonait.bnframework.ui.viewmodel; | |||||
import android.content.Context; | import android.content.Context; | ||||
import android.os.Environment; | import android.os.Environment; | ||||
import com.alibaba.fastjson.TypeReference; | |||||
import com.apkfuns.logutils.LogUtils; | import com.apkfuns.logutils.LogUtils; | ||||
import com.bonait.bnframework.MainApplication; | import com.bonait.bnframework.MainApplication; | ||||
import com.bonait.bnframework.business.RecordManager; | 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.Result.OperateResult; | ||||
import com.bonait.bnframework.common.constant.ConfigName; | 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.file.DBHelper; | ||||
import com.bonait.bnframework.common.db.mode.BPA_ATTRIBUTE; | import com.bonait.bnframework.common.db.mode.BPA_ATTRIBUTE; | ||||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | import com.bonait.bnframework.common.db.mode.BPA_GOODS; | ||||
@@ -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_MATERIAL; | ||||
import com.bonait.bnframework.common.db.mode.BPA_PROCESS; | 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_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.mode.BPA_SUBATTRIBUTE; | ||||
import com.bonait.bnframework.common.db.util.AttributeDBUtil; | import com.bonait.bnframework.common.db.util.AttributeDBUtil; | ||||
import com.bonait.bnframework.common.db.util.GoodsClassifyDBUtil; | 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.db.util.SubAttributeGroupDBUtil; | ||||
import com.bonait.bnframework.common.helper.I.IRunT; | import com.bonait.bnframework.common.helper.I.IRunT; | ||||
import com.bonait.bnframework.common.http.callback.json.JsonDialogCallback; | 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.ProcessModelBean; | ||||
import com.bonait.bnframework.common.model.upload.GoodsDataInfo; | import com.bonait.bnframework.common.model.upload.GoodsDataInfo; | ||||
import com.bonait.bnframework.common.model.upload.GoodsProcessDetail; | import com.bonait.bnframework.common.model.upload.GoodsProcessDetail; | ||||
@@ -271,9 +279,41 @@ public class UpdateDataService { | |||||
* @param goodsId | * @param goodsId | ||||
* @param context | * @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){ | private static void upLoadMaterial(String goodsId,Context context,List<MaterialDataInfo> upMaterialBean){ | ||||
try{ | try{ | ||||
WaitProcessUtil.getInstance().Show("正在上传物料信息,请耐心稍等...","Material information is in progress, please be patient and wait for a moment"); | WaitProcessUtil.getInstance().Show("正在上传物料信息,请耐心稍等...","Material information is in progress, please be patient and wait for a moment"); | ||||
List<BPA_MATERIAL> materials = MaterialUtil.GetMaterialALL(); | List<BPA_MATERIAL> materials = MaterialUtil.GetMaterialALL(); | ||||
if(upMaterialBean==null){ | if(upMaterialBean==null){ | ||||
upMaterialBean = new ArrayList<>(); | upMaterialBean = new ArrayList<>(); | ||||