@@ -75,7 +75,7 @@ public class UpdateAllDataService { | |||
if(goods==null) return; | |||
if (NetworkUtils.checkNetworkAvailable(context)) { | |||
try{ | |||
WaitProcessUtil.getInstance().Show(context,"商品上传","准备上传商品,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show(context,"商品上传","准备上传商品,请耐心稍等...","Product upload","Preparing to upload the product, please be patient for a moment"); | |||
if(UpdateDataService.isDownProcessModel){ | |||
upLoadMaterial(goods,context); | |||
}else { | |||
@@ -98,7 +98,9 @@ public class UpdateAllDataService { | |||
private static void downLoadProcessModel(List<BPA_GOODS> goods, Context context){ | |||
try{ | |||
String url = "http://"+path+"/api/ExternalPlatform/Device/GetDeviceTechnology"; | |||
WaitProcessUtil.getInstance().Show("正在同步云端工艺模型..."); | |||
if(context!=null){ | |||
WaitProcessUtil.getInstance().Show("正在同步云端工艺模型...","Synchronizing cloud process models..."); | |||
} | |||
HashMap<String,String> params = new HashMap<>(); | |||
params.put("autokey",ConfigName.getInstance().DeviceAutoKey); | |||
String body = new Gson().toJson(params); | |||
@@ -242,7 +244,7 @@ public class UpdateAllDataService { | |||
private static void upLoadMaterial(List<BPA_GOODS> goods,Context context){ | |||
try { | |||
WaitProcessUtil.getInstance().Show("正在上传物料信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传物料信息,请耐心稍等...","Material information is in progress, please be patient and wait for a moment"); | |||
List<BPA_MATERIAL> materials = MaterialUtil.GetMaterialALL(); | |||
List<MaterialDataInfo> upMaterialBean = new ArrayList<>(); | |||
@@ -263,7 +265,7 @@ public class UpdateAllDataService { | |||
private static void upLoadClassifyInfo(List<BPA_GOODS> goods,Context context){ | |||
try { | |||
WaitProcessUtil.getInstance().Show("正在上传所有分类信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传分类信息,请耐心稍等...","Uploading category information, please be patient..."); | |||
List<UpClassifyBean> upClassifyBeans = new ArrayList<>(); | |||
goods.forEach(good->{ | |||
BPA_GOODS_CLASSIFY classify = GoodsClassifyDBUtil.getById(good.classifyId); | |||
@@ -290,9 +292,7 @@ public class UpdateAllDataService { | |||
private static void upLoadAttribute(List<UpClassifyBean> upClassifyBeans,List<BPA_GOODS> goods,Context context){ | |||
try { | |||
WaitProcessUtil.getInstance().Show("正在上传所有分类属性,请耐心稍等..."); | |||
// List<BPA_GOODS_CLASSIFY> classifys = GoodsClassifyDBUtil.getAll(); | |||
WaitProcessUtil.getInstance().Show("正在上传分类属性信息,请耐心稍等...","Uploading classified attribute information, please wait..."); | |||
List<UpAttributeBean> upAttributeBeans = new ArrayList<>(); | |||
upClassifyBeans.forEach(ucb->{ | |||
List<BPA_ATTRIBUTE> attributes = AttributeDBUtil.getByClassify(ucb.id); | |||
@@ -326,7 +326,7 @@ public class UpdateAllDataService { | |||
private static void upLoadGoodsInfo(List<BPA_GOODS> goods,Context context){ | |||
try { | |||
WaitProcessUtil.getInstance().Show("正在上传所有商品信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传商品信息,请耐心稍等...","Uploading product information, please be patient for a moment"); | |||
List<GoodsDataInfo> upMaterialBean = new ArrayList<>(); | |||
for(BPA_GOODS good : goods){ | |||
BPA_GOODS_CLASSIFY classify = GoodsClassifyDBUtil.getById(good.classifyId); | |||
@@ -349,7 +349,7 @@ public class UpdateAllDataService { | |||
private static void upLoadDetailInfo(List<BPA_GOODS> goodsList,Context context){ | |||
try { | |||
List<GoodsProcessDetail> goodsProcessDetailList = new ArrayList<>(); | |||
WaitProcessUtil.getInstance().Show("正在上传工艺信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传工艺信息,请耐心稍等...","Uploading process information, please wait..."); | |||
for(BPA_GOODS goods:goodsList){ | |||
GoodsProcessDetail goodsProcessDetail = new GoodsProcessDetail(); | |||
goodsProcessDetail.deviceId = ConfigName.getInstance().DeviceAutoKey; | |||
@@ -80,7 +80,7 @@ public class UpdateDataService { | |||
if(good!=null){ | |||
//等待弹窗 | |||
try{ | |||
WaitProcessUtil.getInstance().Show(context,"商品上传","准备上传商品,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show(context,"商品上传","准备上传商品,请耐心稍等...","Product upload","Preparing to upload the product, please be patient for a moment"); | |||
if(isDownProcessModel){ | |||
upLoadMaterial(good.id,context,null); | |||
}else { | |||
@@ -106,9 +106,7 @@ public class UpdateDataService { | |||
try{ | |||
String url = "http://"+path+"/api/ExternalPlatform/Device/GetDeviceTechnology"; | |||
if(context!=null){ | |||
// WaitProcessUtil.getInstance().show(context,"匹配工艺模型","正在同步云端工艺模型..."); | |||
WaitProcessUtil.getInstance().Show("正在同步云端工艺模型..."); | |||
WaitProcessUtil.getInstance().show(context,"匹配工艺模型","正在同步云端工艺模型...","Matching process model","Synchronizing cloud process models..."); | |||
WaitProcessUtil.getInstance().Show("正在同步云端工艺模型...","Synchronizing cloud process models..."); | |||
} | |||
HashMap<String,String> params = new HashMap<>(); | |||
params.put("autokey",ConfigName.getInstance().DeviceAutoKey); | |||
@@ -273,8 +271,7 @@ public class UpdateDataService { | |||
*/ | |||
private static void upLoadMaterial(String goodsId,Context context,List<MaterialDataInfo> upMaterialBean){ | |||
try{ | |||
// WaitProcessUtil.getInstance().show(context,"数据上传","正在物料信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在物料信息,请耐心稍等..."); | |||
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<>(); | |||
@@ -301,8 +298,7 @@ public class UpdateDataService { | |||
*/ | |||
private static void upLoadClassifyInfo(String goodsId,Context context){ | |||
try{ | |||
// WaitProcessUtil.getInstance().show(context,"数据上传","正在上传分类信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传分类信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传分类信息,请耐心稍等...","Uploading category information, please be patient..."); | |||
BPA_GOODS goods = GoodsDBUtil.getById(goodsId); | |||
assert goods != null; | |||
BPA_GOODS_CLASSIFY classify = GoodsClassifyDBUtil.getById(goods.classifyId); | |||
@@ -339,9 +335,7 @@ public class UpdateDataService { | |||
*/ | |||
private static void upLoadAttribute(List<BPA_ATTRIBUTE> attributes,String goodsId,Context context){ | |||
try{ | |||
// WaitProcessUtil.getInstance().show(context,"数据上传","正在上传分类属性信息,请耐心稍等..."); | |||
// WaitProcessUtil.getInstance().Show("正在上传分类属性信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传分类属性信息,请耐心稍等...","Data Upload","Uploading classified attribute information, please wait..."); | |||
WaitProcessUtil.getInstance().Show("正在上传分类属性信息,请耐心稍等...","Uploading classified attribute information, please wait..."); | |||
BPA_GOODS goods = GoodsDBUtil.getById(goodsId); | |||
assert goods != null; | |||
BPA_GOODS_CLASSIFY classify = GoodsClassifyDBUtil.getById(goods.classifyId); | |||
@@ -381,8 +375,7 @@ public class UpdateDataService { | |||
*/ | |||
private static void upLoadGoodsInfo(String goodsId,Context context){ | |||
try{ | |||
// WaitProcessUtil.getInstance().show(context,"数据上传","正在上传商品信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传商品信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传商品信息,请耐心稍等...","Uploading product information, please be patient for a moment"); | |||
BPA_GOODS goods = GoodsDBUtil.getById(goodsId); | |||
assert goods != null; | |||
BPA_GOODS_CLASSIFY classify = GoodsClassifyDBUtil.getById(goods.classifyId); | |||
@@ -413,9 +406,7 @@ public class UpdateDataService { | |||
*/ | |||
private static void upLoadDetailInfo(String goodsId,Context context){ | |||
try{ | |||
// WaitProcessUtil.getInstance().show(context,"数据上传","正在上传工艺信息,请耐心稍等..."); | |||
// WaitProcessUtil.getInstance().Show("正在上传工艺信息,请耐心稍等..."); | |||
WaitProcessUtil.getInstance().Show("正在上传工艺信息,请耐心稍等...","Data Upload","Uploading process information, please wait..."); | |||
WaitProcessUtil.getInstance().Show("正在上传工艺信息,请耐心稍等...","Uploading process information, please wait..."); | |||
BPA_GOODS goods = GoodsDBUtil.getById(goodsId); | |||
assert goods != null; | |||
BPA_GOODS_CLASSIFY classify = GoodsClassifyDBUtil.getById(goods.classifyId); | |||
@@ -5,6 +5,8 @@ import android.content.Context; | |||
import android.util.Log; | |||
import com.bonait.bnframework.MainApplication; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.ui.dialog.WaiteProgressDialog; | |||
@@ -73,19 +75,34 @@ public class WaitProcessUtil { | |||
//region 等待弹框 | |||
ProgressDialog progressDialog1; | |||
public void Show(Context context,String title, String message){ | |||
public void Show(Context context,String title, String message,String title_en,String message_en){ | |||
MainApplication.handler.post(() -> { | |||
progressDialog1 = new ProgressDialog(context); | |||
progressDialog1.setTitle(title); | |||
switch (ConfigName.getInstance().app.getString(R.string.language)){ | |||
case "en": | |||
progressDialog1.setTitle(title_en); | |||
progressDialog1.setMessage(message_en); | |||
break; | |||
case "zh": | |||
progressDialog1.setTitle(title); | |||
progressDialog1.setMessage(message); | |||
break; | |||
} | |||
progressDialog1.setCancelable(false); | |||
progressDialog1.setMessage(message); | |||
progressDialog1.show(); | |||
}); | |||
} | |||
public void Show(String info){ | |||
public void Show(String info,String message_en){ | |||
if(progressDialog1==null) return; | |||
MainApplication.handler.post(() -> { | |||
progressDialog1.setMessage(info); | |||
switch (ConfigName.getInstance().app.getString(R.string.language)){ | |||
case "en": | |||
progressDialog1.setMessage(message_en); | |||
break; | |||
case "zh": | |||
progressDialog1.setMessage(info); | |||
break; | |||
} | |||
Log.i("WaitShow", "Show: "+info); | |||
}); | |||
} | |||