From 0975281b70bc194af6596a5dce6dea98b45602a6 Mon Sep 17 00:00:00 2001 From: fyf <11621@LAPTOP-04QQU0AO> Date: Sun, 3 Sep 2023 01:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E4=BF=AE=E6=94=B989?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bnframework/business/ConfigData.java | 8 ++++-- .../bonait/bnframework/business/MainInit.java | 25 ++++++++++++++++++ .../home/fragment/from/CpActivity.java | 18 +++++++++++++ .../fragment/mode/QDListSectionAdapter.java | 2 +- .../main/res/mipmap-hdpi/clouddownload.png | Bin 0 -> 512 bytes 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/mipmap-hdpi/clouddownload.png diff --git a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java index a05b84ef..88a50481 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java +++ b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java @@ -525,7 +525,7 @@ public class ConfigData { * * @param context */ - public void GetGoodProcess(Context context, String goodid) { + public void GetGoodProcess(Context context, String goodid,Boolean isSX) { Boolean IsXZ = QueryDB.GetGoodsIDIs(goodid); if (IsXZ) { ToastUtils.warning("请勿重复下载,本地商品已存在!!!"); @@ -630,7 +630,11 @@ public class ConfigData { } } ToastUtils.info("下载菜品成功!!!"); - MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good"); + + if(isSX) + { + MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good"); + } } } } diff --git a/app/src/main/java/com/bonait/bnframework/business/MainInit.java b/app/src/main/java/com/bonait/bnframework/business/MainInit.java index 56f88d16..da31c2e5 100644 --- a/app/src/main/java/com/bonait/bnframework/business/MainInit.java +++ b/app/src/main/java/com/bonait/bnframework/business/MainInit.java @@ -12,6 +12,8 @@ import com.bonait.bnframework.common.db.QueryDB; import com.bonait.bnframework.common.db.file.DBHelper; import com.bonait.bnframework.common.db.mode.BPA_ALERTLOG; import com.bonait.bnframework.common.db.mode.BPA_CLOUDDATA; +import com.bonait.bnframework.common.db.mode.BPA_GOODS; +import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; import com.bonait.bnframework.common.db.mode.BPA_LOG; import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; import com.bonait.bnframework.common.db.mode.BPA_SILOS; @@ -42,6 +44,7 @@ import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager; import org.litepal.LitePal; +import java.util.ArrayList; import java.util.concurrent.TimeUnit; import java.util.logging.Level; @@ -99,9 +102,31 @@ public class MainInit { //设置连接到有线网络 // NetworkUtils.connetEnternet(app); + + //text(); } + //========================================================================// + public static void text() + { + String id="38f0a737-2476-40d8-a7d8-28ff7796e9d2"; + BPA_GOODS gd=QueryDB.GetGoodsId(id); + ArrayList PF=QueryDB.GetGoodsSrecipeID(id); + ArrayList goods= QueryDB.GetGoodsALL(); + for (BPA_GOODS good:goods) + { + if(!good.id.equals(id)) + { + for (BPA_GOODSRECIPE m:PF) + { + m.id=java.util.UUID.randomUUID().toString(); + m.goodsID=good.id; + QueryDB.AddGoodsSrecipe(m); + } + } + } + } /** * 初始化数据库数据(默认数据) */ diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java index 9c3a6dca..3e45c177 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java @@ -245,6 +245,22 @@ public class CpActivity extends BaseActivity { finish(); } }); + + /** + * 下载云端菜谱 + */ + mTopBar.addRightImageButton(R.mipmap.clouddownload,R.id.cLeftImageViewId).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if(ConfigName.getInstance().cloudGoods!=null && ConfigName.getInstance().cloudGoods.size()>0) + { + for (CloudGood item : ConfigName.getInstance().cloudGoods) { + ConfigData.getInstance().GetGoodProcess(context,item.id,false); + } + } + } + }); + /** * 新建商品 */ @@ -254,6 +270,8 @@ public class CpActivity extends BaseActivity { skipToActivity(DiyActivity.class); } }); + + } /** diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java index ffa071c7..7513016d 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java @@ -110,7 +110,7 @@ public class QDListSectionAdapter extends QMUIDefaultStickySectionAdapter { public void onClick(View view) { if(isCloud) { - ConfigData.getInstance().GetGoodProcess(holder.itemView.getContext(),id); + ConfigData.getInstance().GetGoodProcess(holder.itemView.getContext(),id,true); }else { ConfigData.getInstance().UploadGoods(holder.itemView.getContext(),id); diff --git a/app/src/main/res/mipmap-hdpi/clouddownload.png b/app/src/main/res/mipmap-hdpi/clouddownload.png new file mode 100644 index 0000000000000000000000000000000000000000..a8dce87f7f54fd9d75f4169c32f28709e31bf1d1 GIT binary patch literal 512 zcmV+b0{{JqP)Px$x=BPqR9Hvtma!{GQ545N-_d3;$v~MIOu|4?1{)Sx?MfLjG9W9ZWMVTYNti4Y ziIU|PS^Wz~N8YcWm;1Z-J?bs)c;9*7@8_O(&bd!iyi~D2{{X+vfSI)blRyv94-5b| zz#VWUX{Xs|P69BqIiL?{1I~d(3Mcg zHAz3lH3cxU8DKxbASGl`(po++25=0Fr>G~!j7d6ejEw1yrj(_fSGLpLqI3c znyOkLZd;NUbbZw`U}n!icLA|7p*3IyIFj`40-peZN-txO`pyF|E$LBawhSz#zWIl7 zx4^Ii903zWg(ZC}U^6RIu$vC>2DDcM@Z&gu!V?~m;Y;+~I_NQLHm3&MNHjLxESrj5-egXJFcYO%eCt>VJX68le zpUGDcB4_TC?l7hu{UON&Vi0A_lQR&2SeE1$i{B+a%Cq`NI(ep