瀏覽代碼

优化

茶饮新(现场)
fyf 1 年之前
父節點
當前提交
8f78cc89eb
共有 23 個檔案被更改,包括 405 行新增178 行删除
  1. +6
    -22
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +50
    -11
      app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java
  3. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/wdsz_adapter.java
  4. +14
    -7
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/yjrz_adapter.java
  5. +9
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  6. +71
    -57
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java
  7. +10
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/LogActivity.java
  8. +43
    -9
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_lsjy_fragment.java
  9. +2
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_wdsz_fragment.java
  10. +12
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_zdbs_fragment.java
  11. +10
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_zdqx_fragment.java
  12. +50
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java
  13. +27
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java
  14. +12
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/sdkz_control.java
  15. +14
    -14
      app/src/main/res/layout/activity_bottom_navigation_main.xml
  16. +8
    -0
      app/src/main/res/layout/activity_goodpeifang.xml
  17. +1
    -1
      app/src/main/res/layout/fragment_jiaoyan_dzcjy.xml
  18. +1
    -1
      app/src/main/res/layout/fragment_make_good.xml
  19. +23
    -9
      app/src/main/res/layout/item/layout/dialog_add_good.xml
  20. +24
    -10
      app/src/main/res/layout/item/layout/dialog_add_pf.xml
  21. +8
    -7
      app/src/main/res/layout/item/layout/loadinggood_item.xml
  22. +5
    -6
      app/src/main/res/layout/item/layout/newgood_bj.xml
  23. +3
    -3
      app/src/main/res/layout/item/layout/newmakegood.xml

+ 6
- 22
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java 查看文件

@@ -304,8 +304,7 @@ public class ExecuteTheRecipe {
{

ArrayList<ResGoodsRecipe> recipes= GoodMake.recipes;
//复位完成信号
WritePLC("手自切换", true,null);

//region 根据物料配方排序Sort步骤分组
LinkedHashMap<Integer, List<ResGoodsRecipe>> rgrs = new LinkedHashMap<>();
for (int i = 0; i < recipes.size(); i++) {
@@ -317,10 +316,7 @@ public class ExecuteTheRecipe {

int count = 0;
for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) {


WritePLC("配料完成", false,null);
Thread.sleep(10);

final Integer key = entry.getKey();

@@ -333,12 +329,11 @@ public class ExecuteTheRecipe {
}
count=2;
DataBus.getInstance().UpdateGoodsMake(GoodMake.subOrder.id, "步骤【" + key + "】准备下发物料:" + RecipesNames, count, key, false);
ArrayList<Integer> liaochang = new ArrayList<Integer>();
for (int m = 0; m < goodsRecipes.size(); m++) {
ResGoodsRecipe recipe = goodsRecipes.get(m);
final String message = "[" + GoodMake.good.name + "]步骤【" + key + "】下发【" + recipe.materialName + "】";


//获取物料关联的料仓信息
BPA_SILOS silos = null;
List<BPA_SILOS> siloslist = QueryDB.GetSolisByMaterialID(recipe.materialID);
@@ -349,23 +344,12 @@ public class ExecuteTheRecipe {
if (silos == null) {
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "下发失败!物料没有管理料仓!");
} else {
liaochang.add(silos.num);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value);
//MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value);
int _val = (int)Math.round((Double.parseDouble(recipe.value) * 10));

WritePLC("需求值" + silos.num, (short) _val, new IWriteCallBack() {
@Override
public void onSuccess() {
MessageLog.ShowInfo(message + "下发成功!");
}

@Override
public void onFailure(String ErrorMsg) {
MessageLog.ShowInfo(message + "下发失败!" + ErrorMsg);
}
});
WritePLC("需求值" + silos.num, (short) _val, null);
}
}
MessageLog.ShowInfo(RecipesNames + "下发成功!");
//endregion

//等待配料完成,一直等待
@@ -415,7 +399,7 @@ public class ExecuteTheRecipe {
ToastUtils.error("异常信息:" + ex.getMessage());
IsMakeGood=false;
}
Thread.sleep(500);
Thread.sleep(100);
}
@Override
public void RunComplete() throws InterruptedException {


+ 50
- 11
app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java 查看文件

@@ -122,6 +122,7 @@ public class DataBus {
{
try
{
ExecuteTheRecipe.MakeGoodCount++;
ArrayList<String> suorderlist=new ArrayList<>();
for (ResGoodsMake item:GoodsMake)
{
@@ -172,7 +173,7 @@ public class DataBus {
make.makeMs="等待下发物料!";
make.makeProcess=0;
GoodsMake.add(make);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + make.good.name + "]准备配料!");
// MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + make.good.name + "]准备配料!");

if(loadinggoodAdapter!=null)
{
@@ -308,6 +309,7 @@ public class DataBus {

//region 流速校验
public ArrayList<SilosLsjyMode> SilosLsjy = new ArrayList<SilosLsjyMode>();
public lsjy_adapter lsjyAdapter=null;
/**
* 获取流速料仓数据
*/
@@ -320,8 +322,8 @@ public class DataBus {
//加载materials数据
if (bpa_silos.size() > 0) {

Object[] jzkg= ExecuteTheRecipe.ReadPLC("通道1校准开关",20);
Object[] jzz= ExecuteTheRecipe.ReadPLC("校准值1",20);
// Object[] jzkg= ExecuteTheRecipe.ReadPLC("通道1校准开关",20);
// Object[] jzz= ExecuteTheRecipe.ReadPLC("校准值1",20);

for (BPA_SILOS silo : bpa_silos) {
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id);
@@ -330,19 +332,43 @@ public class DataBus {
mode.name= silo.name;
mode.materialName=m.size() > 0?m.get(0).name:"未设置";
//mode.xs= ExecuteTheRecipe.getCalibrationValueXS(silo.num)+"";
Object kg=jzkg[silo.num-1];
Object _val=jzz[silo.num-1];
short val=_val==null?0:(short)_val;
String s = String.valueOf(val);
mode.jzkg= kg==null?false:(boolean) kg;
mode.Value= String.format("%.1f", (Double.parseDouble(s) / 10));
// Object kg=jzkg[silo.num-1];
// Object _val=jzz[silo.num-1];
// short val=_val==null?0:(short)_val;
// String s = String.valueOf(val);
mode.jzkg= false;//kg==null?false:(boolean) kg;
mode.Value="0.0";// //String.format("%.1f", (Double.parseDouble(s) / 10));
SilosLsjy.add(mode);
}
}

if (DataBus.getInstance().lsjyAdapter!=null)
{
DataBus.getInstance().lsjyAdapter.refresh();
}
} catch (Exception e) {
e.printStackTrace();
}
}

public void GetSilosLsjyValue()
{
Object[] jzkg= ExecuteTheRecipe.ReadPLC("通道1校准开关",20);
Object[] jzz= ExecuteTheRecipe.ReadPLC("校准值1",20);
for (SilosLsjyMode mode:SilosLsjy)
{
Object kg=jzkg[mode.num-1];
Object _val=jzz[mode.num-1];
short val=_val==null?0:(short)_val;
String s = String.valueOf(val);
mode.jzkg= kg==null?false:(boolean) kg;
mode.Value= String.format("%.1f", (Double.parseDouble(s) / 10));
}
if (DataBus.getInstance().lsjyAdapter!=null)
{
DataBus.getInstance().lsjyAdapter.refresh();
}
}
//endregion

//region 温度设置
@@ -367,8 +393,8 @@ public class DataBus {
wdszMode mode=new wdszMode();
mode.name=item;
mode.temp=0;
Object sx=ExecuteTheRecipe.ReadPLC(item+"设置");
mode.tempup=sx==null?0:(int)sx;
//Object sx=ExecuteTheRecipe.ReadPLC(item+"设置");
mode.tempup=0;//sx==null?0:(int)sx;
mode.autoheat=false;
if(item.equals("水池温度"))
{
@@ -390,6 +416,19 @@ public class DataBus {
e.printStackTrace();
}
}

public void GetWD()
{
for (wdszMode item:wdszModes)
{
Object sx=ExecuteTheRecipe.ReadPLC(item.name+"设置");
item.tempup=sx==null?0:(int)sx;
}
if (wdszAdapter!=null)
{
wdszAdapter.refresh();
}
}
//endregion

//region 自动清洗


+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/adapter/wdsz_adapter.java 查看文件

@@ -179,8 +179,8 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
@Override
public void run() {
try {
wdszModes.clear();
wdszModes = DataBus.getInstance().wdszModes;
// wdszModes.clear();
// wdszModes = DataBus.getInstance().wdszModes;
notifyDataSetChanged();
} catch (Exception e) {



+ 14
- 7
app/src/main/java/com/bonait/bnframework/modules/home/adapter/yjrz_adapter.java 查看文件

@@ -14,16 +14,17 @@ import androidx.annotation.Nullable;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.res.ResAlertLog;
import com.bonait.bnframework.common.db.res.ResLog;

import java.util.List;

public class yjrz_adapter extends ArrayAdapter<ResAlertLog> {
private List<ResAlertLog> datas;
public class yjrz_adapter extends ArrayAdapter<ResLog> {
private List<ResLog> datas;
private Context context;

private int resource;

public yjrz_adapter(@NonNull Context context, int resource, @NonNull List<ResAlertLog> objects) {
public yjrz_adapter(@NonNull Context context, int resource, @NonNull List<ResLog> objects) {
super(context, resource, objects);
this.context = context;
this.resource=resource;
@@ -33,7 +34,7 @@ public class yjrz_adapter extends ArrayAdapter<ResAlertLog> {
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
ResAlertLog log = (ResAlertLog) getItem(position);//得到当前项选中item实例
ResLog log = (ResLog) getItem(position);//得到当前项选中item实例
//为每一个子项加载设定的布局
View view = LayoutInflater.from(getContext()).inflate(this.resource, parent, false);
//分别获取 image view 和 textview 的实例
@@ -46,13 +47,19 @@ public class yjrz_adapter extends ArrayAdapter<ResAlertLog> {
switch (log.type)
{
case 1:
type.setText("异常订单未制作日志");
type.setText("登录日志");
break;
case 2:
type.setText("料仓缺料日志");
type.setText("角色操作日志");
break;
case 3:
type.setText("传感器异常日志");
type.setText("数据接收");
break;
case 4:
type.setText("上传日志");
break;
case 5:
type.setText("订单处理日志");
break;
}
time.setText(log.createTime);


+ 9
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java 查看文件

@@ -265,6 +265,12 @@ public class MakeGoodFragment extends BaseFragment {
return;
}

if (!clk)
{
ToastUtils.warning("出料口没有检测到器皿!");
return;
}

//判断温度是否到达
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
@@ -402,6 +408,7 @@ public class MakeGoodFragment extends BaseFragment {

int gt1wd=0;
int gt2wd=0;
boolean clk=false;

/**
* 实时显示线程
@@ -420,6 +427,8 @@ public class MakeGoodFragment extends BaseFragment {
{
zhongliangxianshi=String.valueOf((int)obj / 10.0) + " g";
}
Object obj122= ExecuteTheRecipe.ReadPLC("出料口检测");
clk=obj122==null?false:(boolean) obj122;

Object obj1= ExecuteTheRecipe.ReadPLC("水池温度");
if(obj1!=null)


+ 71
- 57
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java 查看文件

@@ -31,6 +31,7 @@ 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.db.res.ResGoodProperty;
import com.bonait.bnframework.common.db.res.ResGoodsRecipe;
import com.bonait.bnframework.common.db.res.lcMode;
import com.bonait.bnframework.common.helper.I.IRunT;
import com.bonait.bnframework.common.helper.I.MyClickListener;
@@ -133,7 +134,7 @@ public class GoodPeiFangActivity extends BaseActivity {
/**
* 商品类型
*/
ArrayList<BPA_GOODSTYPE> goodstypes=new ArrayList<>();
ArrayList<BPA_GOODSTYPE> goodstypes = new ArrayList<>();

private Context context;

@@ -145,17 +146,16 @@ public class GoodPeiFangActivity extends BaseActivity {
setContentView(R.layout.activity_goodpeifang);

ButterKnife.bind(this);
activity=this;
activity = this;
context = getContext();
initTopBar();
Initdata();
}



private void initTopBar() {
mTopBar.setTitle("商品配方管理");
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() {
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
@@ -166,8 +166,8 @@ public class GoodPeiFangActivity extends BaseActivity {
@Override
public void onMessage(Object msg) {
if (msg != null) {
BPA_GOODS xx=(BPA_GOODS) msg;
add_good.setData("编辑",xx,goodstypes,activity);
BPA_GOODS xx = (BPA_GOODS) msg;
add_good.setData("保存", xx, goodstypes, activity);
add_good.setVisibility(View.VISIBLE);
}
}
@@ -177,7 +177,18 @@ public class GoodPeiFangActivity extends BaseActivity {
@Override
public void onMessage(Object msg) {
if (msg != null) {
BPA_GOODS xx=(BPA_GOODS) msg;
BPA_GOODS xx = (BPA_GOODS) msg;

ArrayList<BPA_GOODSRECIPENAME> name=QueryDB.GetGoodsRecipeNameGoodId(xx.id);
for (BPA_GOODSRECIPENAME item:name)
{
ArrayList<ResGoodsRecipe> re= QueryDB.GetGoodsSreciperecipeList(item.id);
for(ResGoodsRecipe item1:re)
{
QueryDB.DeleteGoodsSrecipe(item1);
}
QueryDB.DeleteGoodsRecipeName(item);
}
QueryDB.DeleteGoods(xx);
Initdata();
ToastUtils.info("删除成功!!!");
@@ -190,79 +201,86 @@ public class GoodPeiFangActivity extends BaseActivity {
@Override
public void onMessage(Object msg) {
if (msg != null) {
BPA_GOODS goods=(BPA_GOODS) msg;
BPA_GOODS goods = (BPA_GOODS) msg;

add_pf_home.SetData(goods,goodstypes);
add_pf_home.SetData(goods, goodstypes);
add_pf_home.setVisibility(View.VISIBLE);
}
}
});

//增加商品
add_good.mListener=new MyClickListener() {
add_good.mListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
}

@Override
public void clickListenerNew(View v, int k, Object data) {
if(k==0)
{
if (k == 0) {
add_good.setVisibility(View.GONE);
}else
{
} else if (k == 1) {
Initdata();
ToastUtils.info("执行成功!!!");
add_good.setVisibility(View.GONE);
} else if (k == 2) { //保存并新建配方
Initdata();
ToastUtils.info("执行成功!!!");
add_good.setVisibility(View.GONE);

//打开新建配方界面
BPA_GOODS good = (BPA_GOODS) data;
add_pf.setVisibility(View.VISIBLE);
add_pf.SetData(null, good, bpa_goodproperties);
}
}
};

add_pf_home.mListener=new MyClickListener() {
add_pf_home.mListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
}

@Override
public void clickListenerNew(View v, int k, Object data) {
if(k==0)
{
if (k == 0) {
add_pf_home.setVisibility(View.GONE);
}else if(k==1)
{
} else if (k == 1) {
//新建配方
add_pf_home.setVisibility(View.GONE);

//打开新建配方界面
BPA_GOODS good=(BPA_GOODS)data;
BPA_GOODS good = (BPA_GOODS) data;
add_pf.setVisibility(View.VISIBLE);
add_pf.SetData(null,good,bpa_goodproperties);
}else if(k==2)
{
add_pf.SetData(null, good, bpa_goodproperties);
} else if (k == 2) {
//修改配方
add_pf_home.setVisibility(View.GONE);

BPA_GOODSRECIPENAME SelectDataName= add_pf_home.SelectData;
BPA_GOODSRECIPENAME SelectDataName = add_pf_home.SelectData;
//打开新建配方界面
BPA_GOODS good=(BPA_GOODS)data;
BPA_GOODS good = (BPA_GOODS) data;
add_pf.setVisibility(View.VISIBLE);
add_pf.SetData(SelectDataName,good,bpa_goodproperties);
add_pf.SetData(SelectDataName, good, bpa_goodproperties);
}
}
};

add_pf.mListener=new MyClickListener() {
add_pf.mListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
}

@Override
public void clickListenerNew(View v, int k, Object data) {
if(k==0)
{
if (k == 0) {
add_pf.setVisibility(View.GONE);
} else if (k==1){
add_pf.setVisibility(View.GONE);
ToastUtils.info("保存成功!!!");
}else
{
add_pf.setVisibility(View.GONE);
ToastUtils.info("保存成功!!!");
}
}
};
@@ -273,34 +291,32 @@ public class GoodPeiFangActivity extends BaseActivity {
*/
ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>();
public List<LinkMode> Fdata = new ArrayList<>();

/**
* 初始化数据
*/
public void Initdata()
{
public void Initdata() {

bpa_goodproperties.clear();
ArrayList<BPA_GOODPROPERTY> da = QueryDB.GetGoodsPropertyALL("0");
for (BPA_GOODPROPERTY item:da)
{
ResGoodProperty re=new ResGoodProperty();
re.id=item.id;
re.name=item.name;
for (BPA_GOODPROPERTY item : da) {
ResGoodProperty re = new ResGoodProperty();
re.id = item.id;
re.name = item.name;

ArrayList<BPA_GOODPROPERTY> zsx =QueryDB.GetGoodsPropertyALL(item.id);
re.child=new ArrayList<>();
ArrayList<BPA_GOODPROPERTY> zsx = QueryDB.GetGoodsPropertyALL(item.id);
re.child = new ArrayList<>();


ArrayList<ResGoodProperty> _chid = new ArrayList<>();
for (BPA_GOODPROPERTY k:zsx)
{
ResGoodProperty m=new ResGoodProperty();
m.id=k.id;
m.name=k.name;
m.isSelect=false;
for (BPA_GOODPROPERTY k : zsx) {
ResGoodProperty m = new ResGoodProperty();
m.id = k.id;
m.name = k.name;
m.isSelect = false;
_chid.add(m);
}
re.child=_chid;
re.child = _chid;

bpa_goodproperties.add(re);
}
@@ -311,17 +327,16 @@ public class GoodPeiFangActivity extends BaseActivity {

Fdata.clear();

int i=0;
for(BPA_GOODSTYPE item :goodstypes)
{
ArrayList<BPA_GOODS> goodsm= QueryDB.GetGoodsTypeId(item.id);
Fdata.add(new LinkMode(item, Arrays.asList(goodsm.toArray()), i==0?true:false));
int i = 0;
for (BPA_GOODSTYPE item : goodstypes) {
ArrayList<BPA_GOODS> goodsm = QueryDB.GetGoodsTypeId(item.id);
Fdata.add(new LinkMode(item, Arrays.asList(goodsm.toArray()), i == 0 ? true : false));
i++;
}

LinearLayoutManager manager = (LinearLayoutManager) rv_right.getLayoutManager();
GoodLeftAdapter leftAdapter = new GoodLeftAdapter(R.layout.item_left_good, Fdata,getResources(),manager);
GoodRightAdapter rightAdapter = new GoodRightAdapter(R.layout.item_right_lc, Fdata,getResources());
GoodLeftAdapter leftAdapter = new GoodLeftAdapter(R.layout.item_left_good, Fdata, getResources(), manager);
GoodRightAdapter rightAdapter = new GoodRightAdapter(R.layout.item_right_lc, Fdata, getResources());
rv_left.setAdapter(leftAdapter);
rv_right.setAdapter(rightAdapter);

@@ -332,8 +347,7 @@ public class GoodPeiFangActivity extends BaseActivity {
typeListener.add(((BPA_GOODSTYPE) item.type).name);
}

if(rv_right.getItemDecorationCount()>0)
{
if (rv_right.getItemDecorationCount() > 0) {
rv_right.removeItemDecorationAt(0);
}
TopItemDecoration top = new TopItemDecoration(context, typeListener);
@@ -354,7 +368,7 @@ public class GoodPeiFangActivity extends BaseActivity {
}


@OnClick({R.id.add_sp,R.id.add_fl})
@OnClick({R.id.add_sp, R.id.add_fl})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.add_fl://增加分类
@@ -395,7 +409,7 @@ public class GoodPeiFangActivity extends BaseActivity {
.show();
break;
case R.id.add_sp://增加商品
add_good.setData("新建",null,goodstypes,activity);
add_good.setData("保存", null, goodstypes, activity);
add_good.setVisibility(View.VISIBLE);
break;
}


+ 10
- 5
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/LogActivity.java 查看文件

@@ -26,6 +26,7 @@ import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.res.ResAlertLog;
import com.bonait.bnframework.common.db.res.ResLog;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.adapter.yjrz_adapter;
@@ -73,7 +74,7 @@ public class LogActivity extends BaseActivity {
/**
* 日志数据
*/
ArrayList<ResAlertLog> bpa_logs = new ArrayList<>();
ArrayList<ResLog> bpa_logs = new ArrayList<>();
/**
* 员工操作日志控制器
*/
@@ -132,9 +133,13 @@ public class LogActivity extends BaseActivity {
private void Init(){

lx_map.put("全部日志",0);
lx_map.put("异常订单未制作日志",1);
lx_map.put("料仓缺料日志",2);
lx_map.put("传感器异常日志",3);
lx_map.put("登录日志",1);
lx_map.put("角色操作日志",2);
lx_map.put("数据接收",3);
lx_map.put("上传日志",4);
lx_map.put("订单处理日志",5);


ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(lx_map.keySet()));
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item);
rzlx.setAdapter(adapter2);
@@ -210,7 +215,7 @@ public class LogActivity extends BaseActivity {
}
String lx= rzlx.getSelectedItem().toString();
String text= edittext.getText().toString();
bpa_logs= QueryDB.GetAlertlogs(str,stop, lx_map.get(lx),text);
bpa_logs= QueryDB.Getlogs(str,stop, lx_map.get(lx),text);
adapter = new yjrz_adapter(context,R.layout.yjrz_item,bpa_logs);
datatab.setAdapter(adapter);
} catch (Exception e) {


+ 43
- 9
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_lsjy_fragment.java 查看文件

@@ -239,6 +239,12 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
return;
}

if (!clk)
{
ToastUtils.warning("出料口没有检测到器皿!");
return;
}

//region 判断是否只勾选了一个料仓
SelectSilos();
//endregion
@@ -297,7 +303,6 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
//endregion
}
//region 数据加载
public lsjy_adapter lsjyAdapter=null;
/**
* 初始化数据加载
*/
@@ -309,9 +314,6 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
public void run() {
try {
DataBus.getInstance().GetSilosLsjy();
//底部按钮信息
Object obj= ExecuteTheRecipe.ReadPLC("基准时间");
String time = obj==null?"0":obj.toString();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@@ -319,10 +321,28 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
if(isAdded())
{
Recy_Lsjy.setLayoutManager(new WrapContentLinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL,false));
lsjyAdapter = new lsjy_adapter(getContext());
Recy_Lsjy.setAdapter(lsjyAdapter);
DataBus.getInstance().lsjyAdapter = new lsjy_adapter(getContext());
Recy_Lsjy.setAdapter(DataBus.getInstance().lsjyAdapter);
}
}
});
DataBus.getInstance().GetSilosLsjyValue();
} catch (Exception e) {

}
}
}).start();

new Thread(new Runnable() {
@Override
public void run() {
try {
//底部按钮信息
Object obj= ExecuteTheRecipe.ReadPLC("基准时间");
String time = obj==null?"0":obj.toString();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//校准时间
edittext_jzsj.setText(String.format("%.1f", (Double.parseDouble(time) / 10)));
if (ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
@@ -365,6 +385,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
}
};
int zhongliangxianshi=0;
boolean clk=false;
int gt1wd=0;
int gt2wd=0;
/**
@@ -377,12 +398,16 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
while (ConfigName.getInstance().PlcIsConnect) {
try {
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量");
Object obj1= ExecuteTheRecipe.ReadPLC("出料口检测");

if(obj!=null)
{
zhongliangxianshi=(int)obj;//
mHandler.sendEmptyMessage(0);
}

clk=obj1==null?false:(boolean) obj1;

if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度");
@@ -426,9 +451,9 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
ToastUtils.warning("重量!" +item.Value);
}
}
if (lsjyAdapter!=null)
if (DataBus.getInstance().lsjyAdapter!=null)
{
lsjyAdapter.refresh();
DataBus.getInstance().lsjyAdapter.refresh();
}
}
}, 2000);
@@ -454,7 +479,16 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
public void onDestroy() {
super.onDestroy();
Logger.d("我的fragment销毁");
ExecuteTheRecipe.WritePLC("手自切换", true, null);
new Thread(new Runnable() {
@Override
public void run() {
try {
ExecuteTheRecipe.WritePLC("手自切换", true, null);
} catch (Exception e) {

}
}
}).start();
}

/**


+ 2
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_wdsz_fragment.java 查看文件

@@ -86,14 +86,13 @@ public class JiaoYan_wdsz_fragment extends BaseFragment {
}
});

DataBus.getInstance().GetWD();

} catch (Exception e) {

}
}
}).start();



} catch (Exception e) {

}


+ 12
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_zdbs_fragment.java 查看文件

@@ -16,6 +16,7 @@ import com.bonait.bnframework.business.ConfigData;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.orhanobut.logger.Logger;
import com.suke.widget.SwitchButton;
@@ -81,6 +82,17 @@ public class JiaoYan_zdbs_fragment extends BaseFragment {
{
ConfigName.getInstance().AutomaticWaterRefillTime=edittext_ycsj.getText().toString();
ConfigData.getInstance().SavePZ();



int ftime = 0;
try {
ftime = (int) Math.round((Double.parseDouble(edittext_ycsj.getText().toString()) * 10));
} catch (Exception e) {
ToastUtils.error("校准基准时间异常!" + e.getMessage());
return;
}
ExecuteTheRecipe.WritePLC("自动补水延迟时间", (short) ftime, null);
ToastUtils.info("保存成功!");
}
}
@@ -110,7 +122,6 @@ public class JiaoYan_zdbs_fragment extends BaseFragment {
public void onDestroy() {
super.onDestroy();
Logger.d("我的fragment销毁");
ExecuteTheRecipe.WritePLC("清洗模式",false,null);
}

/**


+ 10
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_zdqx_fragment.java 查看文件

@@ -278,7 +278,16 @@ public class JiaoYan_zdqx_fragment extends BaseFragment {
public void onDestroy() {
super.onDestroy();
Logger.d("我的fragment销毁");
ExecuteTheRecipe.WritePLC("清洗模式",false,null);
new Thread(new Runnable() {
@Override
public void run() {
try {
ExecuteTheRecipe.WritePLC("清洗模式",false,null);
} catch (Exception e) {

}
}
}).start();
}

/**


+ 50
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java 查看文件

@@ -60,7 +60,7 @@ public class add_good_control extends LinearLayout {
/**
* 取消按钮
*/
public Button close_from,xinjian;
public Button close_from,xinjian,save_xinjian;
public ImageView cpfm;

public EditText edittext,edittext1;
@@ -142,6 +142,54 @@ public class add_good_control extends LinearLayout {
}
});

save_xinjian.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(DataVerification()) {

ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
if(Data== null)//新增
{
boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
return;
}
Data=new BPA_GOODS();
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids=ids;
QueryDB.AddGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v,2,Data);
}
}else //修改
{
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids=ids;
QueryDB.UpdateGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v,2,Data);
}
}

}
}
});
close_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -227,7 +275,7 @@ public class add_good_control extends LinearLayout {
private void initView() {
close_from = (Button) findViewById(R.id.close_from);
xinjian = (Button) findViewById(R.id.xinjian);
save_xinjian= (Button) findViewById(R.id.save_xinjian);
cpfm = findViewById(R.id.cpfm);

edittext = findViewById(R.id.edittext);


+ 27
- 5
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java 查看文件

@@ -53,6 +53,8 @@ public class add_pf_control extends LinearLayout implements MyClickListener {
@BindView(R.id.peifang_queren)
Button peifang_queren;

@BindView(R.id.save_peifang_queren)
Button save_peifang_queren;
@BindView(R.id.close_from)
Button close_from;

@@ -231,6 +233,15 @@ public class add_pf_control extends LinearLayout implements MyClickListener {
edittext.setText("");
}

if(bpaGoodsrecipename==null)//新增
{
save_peifang_queren.setVisibility(View.VISIBLE);

}else
{
save_peifang_queren.setVisibility(View.GONE);
}

title.setText(Good.name+"");
initData();
}catch (Exception ex)
@@ -259,6 +270,15 @@ public class add_pf_control extends LinearLayout implements MyClickListener {
}
}
});

save_peifang_queren.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (mListener != null && SaveData()) {
mListener.clickListenerNew(view,2,null);
}
}
});
close_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -408,12 +428,14 @@ public class add_pf_control extends LinearLayout implements MyClickListener {
}

//判断配方是否有相同规格的了
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids,Good.id);
if (goodsrecipename != null) {
ToastUtils.warning("已有改做法配方,不能在新增了!");
return isSuceess;
if(bpaGoodsrecipename==null)//新增
{
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids,Good.id);
if (goodsrecipename != null) {
ToastUtils.warning("已有改做法配方,不能在新增了!");
return isSuceess;
}
}

return true;
}



+ 12
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/sdkz_control.java 查看文件

@@ -63,8 +63,11 @@ public class sdkz_control extends LinearLayout {
aSwitch.setTag(item.zd_address);
// aSwitch.setChecked(ExecuteTheRecipe.ReadPLCSD(item.address));
}
aSwitch.setHeight(55);
aSwitch.setBackground(ConfigName.getInstance().dishesCon.getResources().getDrawable(R.drawable.button2));
aSwitch.setPadding(30,0,0,0);
aSwitch.setHeight(105);
aSwitch.setTextSize(16);
aSwitch.setTextColor(ConfigName.getInstance().dishesCon.getResources().getColor(R.color.white));
aSwitch.setBackground(ConfigName.getInstance().dishesCon.getResources().getDrawable(R.drawable.bg_btn_login_selected));
aSwitch.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
@@ -81,6 +84,13 @@ public class sdkz_control extends LinearLayout {
}
}
}).start();
if(isopen)
{
aSwitch.setBackground(ConfigName.getInstance().dishesCon.getResources().getDrawable(R.drawable.button1));
}else
{
aSwitch.setBackground(ConfigName.getInstance().dishesCon.getResources().getDrawable(R.drawable.bg_btn_login_selected));
}
ToastUtils.info(aSwitch.getText().toString()+",地址:"+addr+".状态:"+isopen);
}
});


+ 14
- 14
app/src/main/res/layout/activity_bottom_navigation_main.xml 查看文件

@@ -79,19 +79,19 @@
</RelativeLayout>

<!--水印-->
<com.bonait.bnframework.common.watermark.WaterMarkView
android:singleLine="false"
android:id="@+id/wm"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:water_mark_align="CENTER"
app:water_mark_degree="-30"
app:water_mark_dx="300px"
app:water_mark_dy="340px"
app:water_mark_sync="true"
app:water_mark_text="黑菠萝技术部"
app:water_mark_textColor="@color/watermarkcolor"
app:water_mark_textBold="true"
app:water_mark_textSize="14px" />
<!-- <com.bonait.bnframework.common.watermark.WaterMarkView-->
<!-- android:singleLine="false"-->
<!-- android:id="@+id/wm"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- app:water_mark_align="CENTER"-->
<!-- app:water_mark_degree="-30"-->
<!-- app:water_mark_dx="300px"-->
<!-- app:water_mark_dy="340px"-->
<!-- app:water_mark_sync="true"-->
<!-- app:water_mark_text="黑菠萝技术部"-->
<!-- app:water_mark_textColor="@color/watermarkcolor"-->
<!-- app:water_mark_textBold="true"-->
<!-- app:water_mark_textSize="14px" />-->

</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 8
- 0
app/src/main/res/layout/activity_goodpeifang.xml 查看文件

@@ -58,6 +58,14 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:textColor="@color/amber_primary_dark"
android:text="(温馨提示:点击商品查看或新建配方.)"
android:textSize="12dp" />
<Button
android:id="@+id/add_sp"
android:layout_width="100dp"


+ 1
- 1
app/src/main/res/layout/fragment_jiaoyan_dzcjy.xml 查看文件

@@ -48,7 +48,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="输入砝码重量"
android:text="请先在称上放入砝码后\n文本框输入砝码重量"
android:textAlignment="center" />
<EditText
android:layout_marginTop="@dimen/dp_10"


+ 1
- 1
app/src/main/res/layout/fragment_make_good.xml 查看文件

@@ -70,7 +70,7 @@
</LinearLayout>

<LinearLayout
android:layout_width="300dp"
android:layout_width="260dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginBottom="35dp">


+ 23
- 9
app/src/main/res/layout/item/layout/dialog_add_good.xml 查看文件

@@ -174,16 +174,30 @@
</LinearLayout>
</RelativeLayout>

<Button
<LinearLayout
android:layout_alignParentBottom="true"
android:id="@+id/xinjian"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/bg_btn_login_selected"
android:text="新建"
android:textColor="@color/white"
android:textSize="18sp"/>
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/xinjian"
android:layout_width="200dp"
android:layout_height="40dp"
android:background="@drawable/bg_btn_login_selected"
android:text="保存"
android:textColor="@color/white"
android:textSize="18sp"/>

<Button
android:id="@+id/save_xinjian"
android:layout_marginLeft="@dimen/dp_10"
android:layout_width="200dp"
android:layout_height="40dp"
android:background="@drawable/button1"
android:text="保存并创建配方"
android:textColor="@color/black"
android:textSize="18sp"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

+ 24
- 10
app/src/main/res/layout/item/layout/dialog_add_pf.xml 查看文件

@@ -232,17 +232,31 @@

</LinearLayout>
</RelativeLayout>

<Button
<LinearLayout
android:layout_alignParentBottom="true"
android:id="@+id/peifang_queren"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/bg_btn_login_selected"
android:text="确认配方"
android:textColor="@color/white"
android:textSize="18sp"/>
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/peifang_queren"
android:layout_width="200dp"
android:layout_height="40dp"
android:background="@drawable/bg_btn_login_selected"
android:text="保存"
android:textColor="@color/white"
android:textSize="18sp"/>

<Button
android:id="@+id/save_peifang_queren"
android:layout_marginLeft="@dimen/dp_10"
android:layout_width="200dp"
android:layout_height="40dp"
android:background="@drawable/button1"
android:text="保存并继续创建"
android:textColor="@color/black"
android:textSize="18sp"/>
</LinearLayout>

</RelativeLayout>
</RelativeLayout>

+ 8
- 7
app/src/main/res/layout/item/layout/loadinggood_item.xml 查看文件

@@ -29,20 +29,21 @@
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">

<TextView
android:id="@+id/loading_xuhao"
android:layout_marginLeft="20dp"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="10dp"
android:text="01"
android:textColor="@color/text4"
android:textSize="19dp"
android:textStyle="bold"
android:textColor="@color/text4"></TextView>
android:textStyle="bold"></TextView>
</RelativeLayout>

<RelativeLayout
android:layout_marginLeft="10dp"
android:layout_marginLeft="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
@@ -71,8 +72,8 @@
android:id="@+id/loading_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2023-33-90 00:00:00"
android:textSize="@dimen/text_size_16"
android:text="2023-33-90 00:00:00"
android:textSize="12dp"
android:textColor="@color/tab_text_normal"/>
</LinearLayout>
</RelativeLayout>


+ 5
- 6
app/src/main/res/layout/item/layout/newgood_bj.xml 查看文件

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="250dp"
android:layout_height="190dp"
android:layout_width="220dp"
android:layout_height="180dp"
>


@@ -10,7 +10,6 @@
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@@ -19,7 +18,7 @@
android:id="@+id/ImageUrl"
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_height="90dp"
android:src="@mipmap/loading3"
android:scaleType="fitXY"
/>
@@ -40,7 +39,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textSize="12dp"
android:textSize="16dp"
android:textColor="@color/light_blue_primary"
android:text="修改"/>
<TextView
@@ -48,7 +47,7 @@
android:layout_marginRight="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12dp"
android:textSize="16dp"
android:layout_alignParentRight="true"
android:textColor="@color/red_primary_dark"
android:text="删除"/>


+ 3
- 3
app/src/main/res/layout/item/layout/newmakegood.xml 查看文件

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="250dp"
android:layout_height="170dp"
android:layout_width="230dp"
android:layout_height="160dp"
>


@@ -19,7 +19,7 @@
android:id="@+id/ImageUrl"
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_height="100dp"
android:src="@mipmap/loading3"
android:scaleType="fitXY"
/>


Loading…
取消
儲存