Browse Source

现场修改89

tags/old_version_1
fyf 1 year ago
parent
commit
0975281b70
5 changed files with 50 additions and 3 deletions
  1. +6
    -2
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +25
    -0
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  3. +18
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java
  4. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java
  5. BIN
     

+ 6
- 2
app/src/main/java/com/bonait/bnframework/business/ConfigData.java View File

@@ -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");
}
}
}
}


+ 25
- 0
app/src/main/java/com/bonait/bnframework/business/MainInit.java View File

@@ -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<BPA_GOODSRECIPE> PF=QueryDB.GetGoodsSrecipeID(id);
ArrayList<BPA_GOODS> 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);
}
}
}
}
/**
* 初始化数据库数据(默认数据)
*/


+ 18
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java View File

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


}

/**


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDListSectionAdapter.java View File

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


BIN
View File


Loading…
Cancel
Save