|
|
@@ -23,10 +23,12 @@ import com.bonait.bnframework.common.constant.ConfigName; |
|
|
|
import com.bonait.bnframework.common.constant.MessageName; |
|
|
|
import com.bonait.bnframework.common.db.QueryDB; |
|
|
|
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_PLCADDRESS; |
|
|
|
import com.bonait.bnframework.common.message.MessageLooper; |
|
|
|
import com.bonait.bnframework.common.message.MessageManager; |
|
|
|
import com.bonait.bnframework.common.model.mode.CloudGood; |
|
|
|
import com.bonait.bnframework.common.utils.AlertDialogUtils; |
|
|
|
import com.bonait.bnframework.common.utils.ScreenUtils; |
|
|
|
import com.bonait.bnframework.common.utils.ToastUtils; |
|
|
|
import com.bonait.bnframework.modules.home.fragment.mode.QDListSectionAdapter; |
|
|
@@ -35,6 +37,8 @@ import com.bonait.bnframework.modules.home.fragment.mode.SectionItem; |
|
|
|
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; |
|
|
|
import com.qmuiteam.qmui.widget.QMUITopBar; |
|
|
|
import com.qmuiteam.qmui.widget.QMUITopBarLayout; |
|
|
|
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; |
|
|
|
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; |
|
|
|
import com.qmuiteam.qmui.widget.section.QMUISection; |
|
|
|
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter; |
|
|
|
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout; |
|
|
@@ -252,12 +256,32 @@ public class CpActivity extends BaseActivity { |
|
|
|
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); |
|
|
|
String title = "同步云端菜谱操作提示!"; |
|
|
|
String message = "请问客官确定要同步菜谱吗?此操作将完全复刻云端菜谱,本地菜谱将清除!请确认本地菜谱已上传云端!!!!"; |
|
|
|
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { |
|
|
|
@Override |
|
|
|
public void onClick(QMUIDialog dialog, int index) { |
|
|
|
|
|
|
|
if(ConfigName.getInstance().cloudGoods!=null && ConfigName.getInstance().cloudGoods.size()>0) |
|
|
|
{ |
|
|
|
ArrayList<BPA_GOODS> goods= QueryDB.GetGoodsALL(); |
|
|
|
ArrayList<BPA_GOODSRECIPE> rec= QueryDB.GetGoodsSrecipeALL(); |
|
|
|
for (BPA_GOODS good:goods) |
|
|
|
{ |
|
|
|
QueryDB.DeleteGoods(good); |
|
|
|
} |
|
|
|
for (BPA_GOODSRECIPE pf:rec) |
|
|
|
{ |
|
|
|
QueryDB.DeleteGoodsSrecipe(pf); |
|
|
|
} |
|
|
|
|
|
|
|
for (CloudGood item : ConfigName.getInstance().cloudGoods) { |
|
|
|
ConfigData.getInstance().GetGoodProcess(context,item.id,false); |
|
|
|
} |
|
|
|
} |
|
|
|
dialog.dismiss(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|