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