Sfoglia il codice sorgente

同步数据修改

调味吧台
liup 5 mesi fa
parent
commit
2d4889472e
3 ha cambiato i file con 12 aggiunte e 4 eliminazioni
  1. +1
    -0
      app/src/main/AndroidManifest.xml
  2. +3
    -2
      app/src/main/java/com/bonait/bnframework/HttpModel/APIService.java
  3. +8
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java

+ 1
- 0
app/src/main/AndroidManifest.xml Vedi File

@@ -30,6 +30,7 @@
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/boluo"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
tools:node="merge"


+ 3
- 2
app/src/main/java/com/bonait/bnframework/HttpModel/APIService.java Vedi File

@@ -91,7 +91,7 @@ public class APIService {

GoodTypeSynchronous(item);//同步云端商品分类信息

GoodPropSynchronous(item.goodsAttributeList);//同步云端商品属性
GoodPropSynchronous(item.goodsTypeId,item.goodsAttributeList);//同步云端商品属性

GoodInfoSynchronous(item,goods);//同步云端商品信息

@@ -115,7 +115,7 @@ public class APIService {
* 同步云端商品属性到本地
* @param goodsAttributeList
*/
private static void GoodPropSynchronous( List<GoodsAttributeList> goodsAttributeList){
private static void GoodPropSynchronous(String goodsTypeId, List<GoodsAttributeList> goodsAttributeList){
goodsAttributeList.forEach(goodProperty->{
//属性添加
BPA_GOODPROPERTY bpa_goodproperty = new BPA_GOODPROPERTY();
@@ -123,6 +123,7 @@ public class APIService {
bpa_goodproperty.parentid ="0";
bpa_goodproperty.id = goodProperty.goodsAttributeId;
bpa_goodproperty.userID="超级管理员";
bpa_goodproperty.GoodsTypeId=goodsTypeId;
QueryDB.AddGoodsProperty(bpa_goodproperty);

//子属性添加


+ 8
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java Vedi File

@@ -14,6 +14,7 @@ import android.widget.Button;

import com.bonait.bnframework.HBL.Dialog.AlertDialogButton;
import com.bonait.bnframework.HBL.Dialog.DialogManager;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.HttpModel.APIService;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseFragment;
@@ -69,8 +70,13 @@ public class GongnengFragment extends BaseFragment {
btn_Sync.setOnClickListener(v->{
DialogManager.showWarn(context,"同步云端商品会参数本地所有配方数据,\r\n请问是否继续?", AlertDialogButton.YesNo,(s)->{
if(s){
APIService.MainInit();
ToastUtils.info("同步成功");
ThreadManager.get().execute(new Runnable() {
@Override
public void run() {
APIService.MainInit();
ToastUtils.info("同步成功");
}
});
}
});
});


Caricamento…
Annulla
Salva