From c7bdfdf50228fc98d9fa6fe5b87534ff0c5f2593 Mon Sep 17 00:00:00 2001 From: liup <1454939542@qq.com> Date: Wed, 5 Jun 2024 14:45:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9UI=E7=BB=86=E8=8A=82=E9=9C=80?= =?UTF-8?q?=E6=B1=82=EF=BC=9B=E5=B1=9E=E6=80=A7=E5=88=86=E7=B1=BB=E6=8F=90?= =?UTF-8?q?=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 3 + .../business/ExecuteTheRecipe.java | 25 ++- .../bonait/bnframework/business/MainInit.java | 15 +- .../common/constant/ConfigName.java | 2 +- .../bonait/bnframework/common/db/QueryDB.java | 17 ++ .../common/linktab/RightAdapter.java | 2 - .../common/linktab/TopItemDecoration.java | 2 +- .../linktab/makegood/MakeGoodLeftAdapter.java | 22 ++- .../common/utils/DisplayManager.java | 2 +- .../bnframework/common/utils/ToastUtils.java | 2 +- .../BottomNavigationMainActivity.java | 2 + .../home/adapter/AttributeSetAdapter.java | 10 - .../modules/home/adapter/sx_adapter.java | 136 -------------- .../home/fragment/DingDanfragment.java | 6 +- .../home/fragment/GongnengFragment.java | 40 ++-- .../home/fragment/MakeGoodFragment.java | 8 +- .../modules/home/fragment/SheZhifragment.java | 6 +- .../from/fragment/Jcsjgl_sxgl_fragment.java | 174 ++++++------------ .../fragment/mode/add_makegood_control.java | 2 + .../home/fragment/mode/add_pf_control.java | 4 - .../home/fragment/mode/silos_jiaoyan.java | 15 +- .../welcome/activity/LoginActivity.java | 1 - .../welcome/activity/WelcomeActivity.java | 2 +- app/src/main/res/layout/activity_jcsjgl.xml | 44 +++-- .../res/layout/datatab/layout/pfsx_item.xml | 12 +- .../res/layout/datatab/layout/sx_item.xml | 31 +--- app/src/main/res/layout/fragment_dingdan.xml | 12 +- app/src/main/res/layout/fragment_gongneng.xml | 53 +++--- .../main/res/layout/fragment_jcsjgl_sxgl.xml | 56 +++--- .../main/res/layout/fragment_make_good.xml | 13 +- app/src/main/res/layout/fragment_she_zhi.xml | 12 +- .../item/layout/dialog_add_makegood.xml | 47 ++--- .../res/layout/item/layout/item_right_lc.xml | 7 + .../layout/item/layout/new_propety_click.xml | 10 +- .../item/layout/silos_jiaoyan_item_edit.xml | 15 +- .../res/layout/item/layout/toast_layout.xml | 4 +- app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 79 +++++++- 38 files changed, 414 insertions(+), 480 deletions(-) delete mode 100644 app/src/main/java/com/bonait/bnframework/modules/home/adapter/sx_adapter.java diff --git a/app/build.gradle b/app/build.gradle index 15a7db20..c97d892e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -66,6 +66,9 @@ android { outputFileName = "boluo-peiliaobatai-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk" } } + buildFeatures { + viewBinding = true + } } dependencies { diff --git a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java index 275378cb..c0a260a3 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -397,7 +397,6 @@ public class ExecuteTheRecipe { ArrayList recipes= GoodMake.recipes; //region 根据物料配方排序Sort步骤分组 - MainInit.initToastString(); LinkedHashMap> rgrs = new LinkedHashMap<>(); for (int i = 0; i < recipes.size(); i++) { if (!rgrs.containsKey(recipes.get(i).sort)) @@ -409,7 +408,6 @@ public class ExecuteTheRecipe { int count = 0; boolean isError = false; - MainInit.initToastString(); for (LinkedHashMap.Entry> entry : rgrs.entrySet()) { WritePLC("配料完成", false,null); @@ -452,22 +450,23 @@ public class ExecuteTheRecipe { if(res!=null){ String name = silos.name+silos.num+"出料时间"; outValue = Unity.Scale(_val,res.inputWightMax,res.inputWightMin,res.outputTimeMax,res.outputTimeMin); - MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "写入地址:"+name+"地址值:"+outValue*100); +// MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "写入地址:"+name+"地址值:"+outValue*100); LogUtils.d("商品制作线程 name="+name+"; outValue="+outValue); WritePLC(name, (short) (outValue*100), null); + //減去料仓数量 + int otherG=silos.silosmargin-(int)(_val); + QueryDB.UpdateYL(silos.id,otherG>=0?otherG:0); + LogUtils.d("商品制作线程 _val="+_val+" ;otherG = "+otherG+";silos.silosmargin="+silos.silosmargin); }else{ MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "下发失败!物料没有对应的校准值!"); + Thread.sleep(2000); + IsComplete[0] = true; + isError = true; } - //減去料仓数量 - int otherG=silos.silosmargin-(int)(_val); - QueryDB.UpdateYL(silos.id,otherG>=0?otherG:0); - LogUtils.d("商品制作线程 _val="+_val+" ;otherG = "+otherG+";silos.silosmargin="+silos.silosmargin); } } - MessageLog.ShowInfo(RecipesNames + "下发成功!"); +// MessageLog.ShowInfo(RecipesNames + "下发成功!"); //endregion - - OnChargeMixtureCompleteNotify = new IRun() { @Override public void Run() { @@ -482,7 +481,7 @@ public class ExecuteTheRecipe { WritePLC("配料启动",true,new IWriteCallBack() { @Override public void onSuccess() { - MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料成功!"); +// MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料成功!"); } @Override @@ -503,7 +502,7 @@ public class ExecuteTheRecipe { //更新缓存商品制作列表状态 count += goodsRecipes.size(); DataBus.getInstance().UpdateGoodsMake(GoodMake.subOrder.id, "步骤【" + key + "】:" + RecipesNames + "-配料完成!", count, key, true); - MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + GoodMake.good.name + "]步骤【" + key + "】下发" + RecipesNames + "执行完成!"); +// MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + GoodMake.good.name + "]步骤【" + key + "】下发" + RecipesNames + "执行完成!"); } DataBus.getInstance().DeleteGoodsMake(GoodMake.subOrder.id,isError); @@ -516,7 +515,6 @@ public class ExecuteTheRecipe { GoodMake=null; IsMakeGood=false; - MainInit.initToastString(); OnChargeMixtureCompleteNotify = null; } @@ -524,7 +522,6 @@ public class ExecuteTheRecipe { } catch (Exception ex) { ToastUtils.error("异常信息:" + ex.getMessage()); IsMakeGood=false; - MainInit.initToastString(); } Thread.sleep(500); } 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 4f4e6e93..c77e24e2 100644 --- a/app/src/main/java/com/bonait/bnframework/business/MainInit.java +++ b/app/src/main/java/com/bonait/bnframework/business/MainInit.java @@ -201,17 +201,17 @@ public class MainInit { // DBHelper.getInstance(this).DeleteCreateTables(BPA_PLCADDRESS.class,null); } - public static StringBuffer toastString = new StringBuffer(); +// public static StringBuffer toastString = new StringBuffer(); - public static void initToastString(){ - toastString.setLength(0); - } +// public static void initToastString(){ +// toastString.setLength(0); +// } /** * 初始化消息日志接收打印 */ public static void InitMsgLog(){ - initToastString(); +// initToastString(); MessageLog.MsgNotify = new IMessageLogNotify() { @Override public void ErrorMsg(String msg) { @@ -243,8 +243,9 @@ public class MainInit { if(msg.contains("登录")){ ToastUtils.info(msg, Toast.LENGTH_SHORT); }else { - toastString.append(msg).append("|"); - ToastUtils.info(toastString.subSequence(0,toastString.length()-1).toString(), Toast.LENGTH_LONG); +// toastString.append(msg).append("|"); +// ToastUtils.info(toastString.subSequence(0,toastString.length()-1).toString(), Toast.LENGTH_LONG); + ToastUtils.info(msg, Toast.LENGTH_SHORT); } switch (type.toString()) { diff --git a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java index 92e4f2c2..ab84e2b5 100644 --- a/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java +++ b/app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java @@ -46,7 +46,7 @@ import java.util.concurrent.ConcurrentHashMap; * 配置文件 */ public class ConfigName { - public static final boolean TEST = false; + public static final boolean TEST = true; public static final boolean TEST2 = false; //region 单例模式 private static ConfigName mInstance; //实例变量设置私有,防止直接通过类名访问 diff --git a/app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java b/app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java index 16ad004e..6a093836 100644 --- a/app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java +++ b/app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java @@ -1187,6 +1187,23 @@ public class QueryDB { return data; } + /** + * 获取分类下的父属性 + * + * @return + */ + public static ArrayList GetGoodsPropertyByTypeId(String GoodsTypeId) { + String orderby = Desc_Sort_Up + ',' +Desc_Time_Up;//先按排序 创建时间倒序 + String where = "isDelete=? and GoodsTypeId=?"; + String[] args = new String[]{"0", GoodsTypeId}; + ArrayList data = new ArrayList<>(); + ArrayList obj = Get(BPA_GOODPROPERTY.class, where, args, orderby); + for (Object k : obj) { + data.add((BPA_GOODPROPERTY) k); + } + return data; + } + /** * 判断是否存在 * diff --git a/app/src/main/java/com/bonait/bnframework/common/linktab/RightAdapter.java b/app/src/main/java/com/bonait/bnframework/common/linktab/RightAdapter.java index f3540e6d..1a281c6b 100644 --- a/app/src/main/java/com/bonait/bnframework/common/linktab/RightAdapter.java +++ b/app/src/main/java/com/bonait/bnframework/common/linktab/RightAdapter.java @@ -10,8 +10,6 @@ import androidx.recyclerview.widget.RecyclerView; import com.bonait.bnframework.R; import com.bonait.bnframework.common.view.MyLayoutManager; import com.bonait.bnframework.modules.home.adapter.liaochang_adapter; -import com.bonait.bnframework.modules.home.adapter.sx_adapter; -import com.bonait.bnframework.modules.home.adapter.zsx_adapter; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.viewholder.BaseViewHolder; diff --git a/app/src/main/java/com/bonait/bnframework/common/linktab/TopItemDecoration.java b/app/src/main/java/com/bonait/bnframework/common/linktab/TopItemDecoration.java index 0438ff62..a9d56ddb 100644 --- a/app/src/main/java/com/bonait/bnframework/common/linktab/TopItemDecoration.java +++ b/app/src/main/java/com/bonait/bnframework/common/linktab/TopItemDecoration.java @@ -35,7 +35,7 @@ public class TopItemDecoration extends RecyclerView.ItemDecoration{ { mContext=_context; mPaint.setColor(ContextCompat.getColor(mContext, R.color.main_background)); - textPaint.setColor(ContextCompat.getColor(mContext, R.color.black)); + textPaint.setColor(ContextCompat.getColor(mContext, R.color.app_color_blue)); textPaint.setTextSize(25f); typeListener=type; } diff --git a/app/src/main/java/com/bonait/bnframework/common/linktab/makegood/MakeGoodLeftAdapter.java b/app/src/main/java/com/bonait/bnframework/common/linktab/makegood/MakeGoodLeftAdapter.java index be7e4266..718d0099 100644 --- a/app/src/main/java/com/bonait/bnframework/common/linktab/makegood/MakeGoodLeftAdapter.java +++ b/app/src/main/java/com/bonait/bnframework/common/linktab/makegood/MakeGoodLeftAdapter.java @@ -40,11 +40,9 @@ public class MakeGoodLeftAdapter extends BaseQuickAdapter { - /** - * 内部点击事件 - */ - private MyClickListener mListener; - private List datas; - - private ArrayList goodstypes; - int resource1; - public Context contextA; - public sx_adapter(@NonNull Context context, int resource, @NonNull List objects, ArrayList bpa_goodstypes, MyClickListener listener) { - super(context, resource, objects); - mListener = listener; - contextA=context; - datas=objects; - goodstypes=bpa_goodstypes; - this.resource1=resource; - } - //每个子项被滚动到屏幕内的时候会被调用 - @NonNull - @Override - public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { - BPA_GOODPROPERTY bpa_goodproperty = (BPA_GOODPROPERTY) getItem(position);//得到当前项选中item实例 - //为每一个子项加载设定的布局 - View view = LayoutInflater.from(getContext()).inflate(resource1, parent, false); - view.setOnClickListener(KeyboardUtil::hideKeyboard); - //分别获取 image view 和 textview 的实例 - TextView name = view.findViewById(R.id.name);//属性名称 - TextView sort = view.findViewById(R.id.sort);//排序 - TextView typeS = view.findViewById(R.id.typeS);//排序 - - ImageView button = view.findViewById(R.id.button_item);//删除 - ImageView button_add = view.findViewById(R.id.button_add);//增加 子属性 - - RecyclerView recyclerView=view.findViewById(R.id.recycler_view); - ArrayList zsx= QueryDB.GetGoodsPropertyALL(bpa_goodproperty.id); - MyLayoutManager layout = new MyLayoutManager(); - layout.setAutoMeasureEnabled(true); - recyclerView.setLayoutManager(layout); - zsx_adapter zsxadapter = new zsx_adapter(position,contextA,zsx,mListener); - recyclerView.setAdapter(zsxadapter); - - - - // 设置要显示的图片和文字 - name.setText(bpa_goodproperty.name); - sort.setText(bpa_goodproperty.sort+""); - - typeS.setText(GetName(bpa_goodproperty.GoodsTypeId)); - name.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if(mListener!=null) mListener.clickListenerNew(view,position,bpa_goodproperty); - } - }); - - sort.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if(mListener!=null) mListener.clickListenerNew(view,position,bpa_goodproperty); - } - }); - - typeS.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if(mListener!=null) mListener.clickListenerNew(view,position,bpa_goodproperty); - } - }); - - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if(mListener!=null) mListener.clickListenerNew(view,position,bpa_goodproperty); - } - }); - - button_add.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if(mListener!=null) mListener.clickListenerNew(view,position,bpa_goodproperty); - } - }); - return view; - } - - public String GetName(String ids) - { - String name=""; - if(ids==null || ids.isEmpty()) - { - return ""; - } - for (BPA_GOODSTYPE item:goodstypes) - { - if(ids.contains(item.id)) - { - name+=item.name+","; - } - } - - if(!name.isEmpty()) - { - name=name.substring(0, name.length() - 1); - } - - return name; - } -} diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/DingDanfragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/DingDanfragment.java index fcd6180a..aad457a0 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/DingDanfragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/DingDanfragment.java @@ -28,8 +28,8 @@ import butterknife.OnClick; public class DingDanfragment extends BaseFragment { - @BindView(R.id.topbar) - QMUITopBarLayout mTopBar;//顶部标题 +// @BindView(R.id.topbar) +// QMUITopBarLayout mTopBar;//顶部标题 private Context context; public DingDanfragment() { @@ -54,7 +54,7 @@ public class DingDanfragment extends BaseFragment { */ private void initTopBar() { // mTopBar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.app_color_theme_4)); - mTopBar.setTitle("订单管理"); +// mTopBar.setTitle("订单管理"); } @OnClick({R.id.ddgl,R.id.xltj}) diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java index 5154b66b..88573147 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java @@ -44,11 +44,11 @@ import butterknife.OnClick; public class GongnengFragment extends BaseFragment { - @BindView(R.id.topbar) - QMUITopBarLayout mTopBar;//顶部标题 - - @BindView(R.id.btn_sync) - Button btn_Sync; +// @BindView(R.id.topbar) +// QMUITopBarLayout mTopBar;//顶部标题 +// +// @BindView(R.id.btn_sync) +// Button btn_Sync; private Context context; @@ -73,21 +73,21 @@ public class GongnengFragment extends BaseFragment { * 初始化TopBar */ private void initTopBar() { - mTopBar.setTitle("功能菜单"); - btn_Sync.setOnClickListener(v->{ - DialogManager.showWarn(context,"同步云端商品会参数本地所有配方数据,\r\n请问是否继续?", AlertDialogButton.YesNo,(s)->{ - if(s){ - WaitDialog.getInstance().Show("同步数据","请耐心等待,不要关闭应用",getContext(),getActivity()); - ThreadManager.get().execute(new Runnable() { - @Override - public void run() { - APIService.MainInit(); - EventBus.getDefault().post(new SynchronousCloudDataEvent()); - } - }); - } - }); - }); +// mTopBar.setTitle("功能菜单"); +// btn_Sync.setOnClickListener(v->{ +// DialogManager.showWarn(context,"同步云端商品会参数本地所有配方数据,\r\n请问是否继续?", AlertDialogButton.YesNo,(s)->{ +// if(s){ +// WaitDialog.getInstance().Show("同步数据","请耐心等待,不要关闭应用",getContext(),getActivity()); +// ThreadManager.get().execute(new Runnable() { +// @Override +// public void run() { +// APIService.MainInit(); +// EventBus.getDefault().post(new SynchronousCloudDataEvent()); +// } +// }); +// } +// }); +// }); } @OnClick({R.id.jcsjgl,R.id.lcgl,R.id.yfpf,R.id.log,R.id.ssjk}) public void onViewClicked(View view) { diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java index a274eccf..f6ea97ee 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java @@ -119,8 +119,8 @@ public class MakeGoodFragment extends BaseFragment { private QMUIViewPager viewPager; - @BindView(R.id.topbar) - QMUITopBarLayout mTopBar;//顶部标题 +// @BindView(R.id.topbar) +// QMUITopBarLayout mTopBar;//顶部标题 /** * 左边分类 @@ -475,7 +475,7 @@ public class MakeGoodFragment extends BaseFragment { */ private void initTopBar() { - mTopBar.setTitle("智慧菠萝点餐系统" + ConfigName.getInstance().Version); +// mTopBar.setTitle("智慧菠萝点餐系统" + ConfigName.getInstance().Version); // mTopBar.addLeftImageButton(R.mipmap.silos1, 1).setOnClickListener(new View.OnClickListener() { // @Override @@ -720,7 +720,7 @@ public class MakeGoodFragment extends BaseFragment { if(mHandler!=null){ try { mHandler.sendEmptyMessage(0); - if(time>=60) //12秒执行一次 + if(time>=60) //60秒执行一次 { ArrayList lcModes = DataBus.getInstance().ResGetLc(); String title=""; diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/SheZhifragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/SheZhifragment.java index 2218a1d3..91c8bf27 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/SheZhifragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/SheZhifragment.java @@ -26,8 +26,8 @@ import butterknife.OnClick; public class SheZhifragment extends BaseFragment { - @BindView(R.id.topbar) - QMUITopBarLayout mTopBar;//顶部标题 +// @BindView(R.id.topbar) +// QMUITopBarLayout mTopBar;//顶部标题 private Context context; public SheZhifragment() { @@ -51,7 +51,7 @@ public class SheZhifragment extends BaseFragment { * 初始化TopBar */ private void initTopBar() { - mTopBar.setTitle("订单管理"); +// mTopBar.setTitle("订单管理"); } @OnClick({R.id.xtcs,R.id.imagegl,R.id.shebeixinxi diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/Jcsjgl_sxgl_fragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/Jcsjgl_sxgl_fragment.java index c5dc32ef..2d6f4130 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/Jcsjgl_sxgl_fragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/Jcsjgl_sxgl_fragment.java @@ -2,6 +2,7 @@ package com.bonait.bnframework.modules.home.fragment.from.fragment; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Context; @@ -11,7 +12,9 @@ import android.text.InputType; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; +import android.widget.LinearLayout; import android.widget.ListView; +import android.widget.TextView; import com.bonait.bnframework.R; import com.bonait.bnframework.common.base.BaseFragment; @@ -19,21 +22,24 @@ import com.bonait.bnframework.common.constant.ConfigName; import com.bonait.bnframework.common.constant.DataBus; import com.bonait.bnframework.common.db.QueryDB; import com.bonait.bnframework.common.db.mode.BPA_GOODPROPERTY; +import com.bonait.bnframework.common.db.mode.BPA_GOODS; import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME; import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE; import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; import com.bonait.bnframework.common.helper.I.MyClickListener; +import com.bonait.bnframework.common.linktab.LinkMode; +import com.bonait.bnframework.common.linktab.makegood.MakeGoodLeftAdapter; import com.bonait.bnframework.common.utils.AlertDialogUtils; import com.bonait.bnframework.common.utils.KeyboardUtil; import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.modules.home.adapter.AttributeSetAdapter; -import com.bonait.bnframework.modules.home.adapter.sx_adapter; import com.orhanobut.logger.Logger; import com.qmuiteam.qmui.widget.QMUIWindowInsetLayout; import com.qmuiteam.qmui.widget.dialog.QMUIDialog; import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.concurrent.ConcurrentHashMap; @@ -46,7 +52,14 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment {// implements MyClickLis @BindView(R.id.datatab_sx) RecyclerView datatab_sx; @BindView(R.id.root) - QMUIWindowInsetLayout root; + LinearLayout root; + @BindView(R.id.recyclerView) + RecyclerView recyclerView; + @BindView(R.id.ll_content) + LinearLayout llContent; + @BindView(R.id.tip) + TextView textTip; + /** * 属性数据 */ @@ -54,6 +67,7 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment {// implements MyClickLis ArrayList bpa_goodstypes=new ArrayList<>(); ConcurrentHashMap itemstypes=new ConcurrentHashMap<>(); + private String goodsTypeId = ""; private Context context; @Override @@ -85,8 +99,46 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment {// implements MyClickLis itemstypes.put(item.name,item.id); } } + initLeftView(); + } + + private List leftData = new ArrayList<>(); + private void initLeftView(){ + leftData.clear(); + int i = 0; + for (BPA_GOODSTYPE item : QueryDB.GetGoodsTypeALL()) { + ArrayList goodsm = QueryDB.GetGoodsTypeId(item.id); + leftData.add(new LinkMode(item, Arrays.asList(goodsm.toArray()), i == 0 ? true : false)); + i++; + } + MakeGoodLeftAdapter leftAdapter = new MakeGoodLeftAdapter(R.layout.item_left_makegood, leftData, getResources(), null); + leftAdapter.setCallBack(new MakeGoodLeftAdapter.ClickCallBack() { + @Override + public void onClickItem(View v, BPA_GOODSTYPE type) { + goodsTypeId = type.id; + Initdata_sx(); + } + }); + recyclerView.setAdapter(leftAdapter); + if(leftData.isEmpty()){ + llContent.setVisibility(View.GONE); + textTip.setVisibility(View.VISIBLE); + }else { + llContent.setVisibility(View.VISIBLE); + textTip.setVisibility(View.GONE); + goodsTypeId = ((BPA_GOODSTYPE) leftData.get(0).type).id; + Initdata_sx(); + } + } - Initdata_sx(0); + /** + * 初始化数据加载 + */ + public void Initdata_sx() { + bpa_goodproperties = QueryDB.GetGoodsPropertyByTypeId(goodsTypeId); + AttributeSetAdapter adapter = new AttributeSetAdapter(context, bpa_goodproperties, bpa_goodstypes,listener); + datatab_sx.setAdapter(adapter); + adapter.notifyDataSetChanged(); } @OnClick({R.id.add_sx}) @@ -118,6 +170,7 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment {// implements MyClickLis bpa_goodproperty.foreignKeyRe = ""; bpa_goodproperty.parentid = "0"; bpa_goodproperty.sort=0; + bpa_goodproperty.GoodsTypeId=goodsTypeId; bpa_goodproperty.deviceID = ConfigName.getInstance().DeviceId; bpa_goodproperty.userID = ConfigName.getInstance().user.userID; QueryDB.AddGoodsProperty(bpa_goodproperty); @@ -225,72 +278,6 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment {// implements MyClickLis }) .show(); break; - case R.id.typeS: - ArrayList keys=new ArrayList(); - String[] items = itemstypes.keySet().toArray(new String[itemstypes.keySet().size()]); - - - - if(((BPA_GOODPROPERTY) data).GoodsTypeId!=null && !((BPA_GOODPROPERTY) data).GoodsTypeId.isEmpty()) - { - for (int i=0;i0){ -// if(position>=bpa_goodproperties.size()-1){ -// datatab_sx.smoothScrollToPosition(bpa_goodproperties.size()-1); -// }else { -// datatab_sx.smoothScrollToPosition(position); -// } -// } -// } -// },500); - - } catch (Exception e) { - - } - } - //endregion - @Override public void onDestroy() { super.onDestroy(); diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_makegood_control.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_makegood_control.java index 39bf53e6..abd7b143 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_makegood_control.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_makegood_control.java @@ -30,6 +30,7 @@ import com.bonait.bnframework.common.db.res.ResGoodProperty; import com.bonait.bnframework.common.db.res.ResGoodsRecipe; import com.bonait.bnframework.common.helper.I.MyClickListener; import com.bonait.bnframework.common.helper.WrapContentLinearLayoutManager; +import com.bonait.bnframework.common.utils.DisplayManager; import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.common.view.MyLayoutManager; import com.bonait.bnframework.modules.home.adapter.newneatril_adapter; @@ -74,6 +75,7 @@ public class add_makegood_control extends LinearLayout{ contextMian=context; root = LayoutInflater.from(context).inflate(R.layout.dialog_add_makegood, this); ButterKnife.bind(this, root); + DisplayManager.scaleViewGroup(root.findViewById(R.id.root)); Init(); } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java index 60605f3d..ccb17673 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java @@ -34,12 +34,8 @@ import com.bonait.bnframework.common.message.MessageLooper; import com.bonait.bnframework.common.message.MessageManager; import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.common.view.MyLayoutManager; -import com.bonait.bnframework.modules.home.adapter.loadinggood_adapter; -import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter; import com.bonait.bnframework.modules.home.adapter.newneatril_adapter; import com.bonait.bnframework.modules.home.adapter.pfsx_adapter; -import com.bonait.bnframework.modules.home.adapter.sx_adapter; -import com.bonait.bnframework.modules.home.adapter.wl_adapter; import com.bonait.bnframework.modules.home.adapter.xxpf_adapter; import java.util.ArrayList; diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java index 12671fa6..66e37618 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java @@ -30,6 +30,7 @@ import com.bonait.bnframework.common.db.QueryDB; import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE; import com.bonait.bnframework.common.db.res.lcMode; import com.bonait.bnframework.common.helper.I.IRun; +import com.bonait.bnframework.common.helper.I.IWriteCallBack; import com.bonait.bnframework.common.helper.I.MyClickListener; import com.bonait.bnframework.common.helper.MessageLog; import com.bonait.bnframework.common.utils.AlertDialogUtils; @@ -304,9 +305,21 @@ public class silos_jiaoyan extends LinearLayout { * 按钮单击事件 * @param view */ - @OnClick({R.id.btn_min_standard, R.id.btn_max_standard,R.id.btn_sim_discharge,R.id.btn_save}) + @OnClick({R.id.btn_min_standard, R.id.btn_max_standard,R.id.btn_sim_discharge,R.id.btn_save,R.id.btn_clear}) public void onViewClicked(View view) { switch (view.getId()) { + case R.id.btn_clear: + ExecuteTheRecipe.WritePLC("重量清零", true, new IWriteCallBack() { + @Override + public void onSuccess() { + ToastUtils.info("清零成功!"); + } + @Override + public void onFailure(String ErrorMsg) { + ToastUtils.error("清零失败!"); + } + }); + break; case R.id.btn_max_standard: case R.id.btn_min_standard: float time = EditTextValidate(view.getId()==R.id.btn_min_standard? min_time:max_time,"请输入正确的时间"); diff --git a/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java b/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java index 207910be..4ae53885 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java @@ -214,7 +214,6 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL BPA_USER user= QueryDB.UserLogin(userAccount,password); if(user!=null) { - MainInit.initToastString(); MessageLog.ShowUserMessage(UserLogEnum.登录日志,user.name+"-登录成功"); ConfigName.getInstance().user=user; ConfigData.getInstance().SavePZ(); diff --git a/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/WelcomeActivity.java b/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/WelcomeActivity.java index 249a3162..4592a193 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/WelcomeActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/WelcomeActivity.java @@ -41,7 +41,7 @@ public class WelcomeActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome); initWelcome(); - DisplayManager.setReferenceMaxWidthHeight(800, 1208); + DisplayManager.setReferenceMaxWidthHeight(1208, 800); DisplayManager.updateDisplayInfo(this); } diff --git a/app/src/main/res/layout/activity_jcsjgl.xml b/app/src/main/res/layout/activity_jcsjgl.xml index acb0b72c..e305472f 100644 --- a/app/src/main/res/layout/activity_jcsjgl.xml +++ b/app/src/main/res/layout/activity_jcsjgl.xml @@ -8,29 +8,33 @@ android:background="@color/white" android:fitsSystemWindows="true"> - - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/datatab/layout/pfsx_item.xml b/app/src/main/res/layout/datatab/layout/pfsx_item.xml index 587c2ecf..62d59ec5 100644 --- a/app/src/main/res/layout/datatab/layout/pfsx_item.xml +++ b/app/src/main/res/layout/datatab/layout/pfsx_item.xml @@ -4,6 +4,9 @@ android:layout_height="wrap_content" android:orientation="horizontal" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + android:paddingTop="15dp" + android:paddingBottom="5dp" + android:background="@drawable/input_bj" xsi:schemaLocation="http://schemas.android.com/apk/res/android "> + android:textSize="24sp" /> diff --git a/app/src/main/res/layout/datatab/layout/sx_item.xml b/app/src/main/res/layout/datatab/layout/sx_item.xml index 4fba3402..366b5f77 100644 --- a/app/src/main/res/layout/datatab/layout/sx_item.xml +++ b/app/src/main/res/layout/datatab/layout/sx_item.xml @@ -18,23 +18,6 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal"> - - - - - + android:textSize="13dp"/> - + - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_gongneng.xml b/app/src/main/res/layout/fragment_gongneng.xml index 3a9443c6..0d6994ff 100644 --- a/app/src/main/res/layout/fragment_gongneng.xml +++ b/app/src/main/res/layout/fragment_gongneng.xml @@ -6,10 +6,10 @@ android:layout_height="match_parent" android:background="@color/app_color_blue"> + - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item/layout/silos_jiaoyan_item_edit.xml b/app/src/main/res/layout/item/layout/silos_jiaoyan_item_edit.xml index 8cc3a2d0..a96d7d8e 100644 --- a/app/src/main/res/layout/item/layout/silos_jiaoyan_item_edit.xml +++ b/app/src/main/res/layout/item/layout/silos_jiaoyan_item_edit.xml @@ -17,7 +17,7 @@ @@ -39,10 +39,21 @@ android:id="@+id/current_weight" android:layout_width="wrap_content" android:layout_height="wrap_content" - tools:text="实际出料重量:" + tools:text="100g" + android:textSize="20sp"/> + +