@@ -304,8 +304,7 @@ public class ExecuteTheRecipe { | |||||
{ | { | ||||
ArrayList<ResGoodsRecipe> recipes= GoodMake.recipes; | ArrayList<ResGoodsRecipe> recipes= GoodMake.recipes; | ||||
//复位完成信号 | |||||
WritePLC("手自切换", true,null); | |||||
//region 根据物料配方排序Sort步骤分组 | //region 根据物料配方排序Sort步骤分组 | ||||
LinkedHashMap<Integer, List<ResGoodsRecipe>> rgrs = new LinkedHashMap<>(); | LinkedHashMap<Integer, List<ResGoodsRecipe>> rgrs = new LinkedHashMap<>(); | ||||
for (int i = 0; i < recipes.size(); i++) { | for (int i = 0; i < recipes.size(); i++) { | ||||
@@ -317,10 +316,7 @@ public class ExecuteTheRecipe { | |||||
int count = 0; | int count = 0; | ||||
for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) { | for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) { | ||||
WritePLC("配料完成", false,null); | WritePLC("配料完成", false,null); | ||||
Thread.sleep(10); | |||||
final Integer key = entry.getKey(); | final Integer key = entry.getKey(); | ||||
@@ -333,12 +329,11 @@ public class ExecuteTheRecipe { | |||||
} | } | ||||
count=2; | count=2; | ||||
DataBus.getInstance().UpdateGoodsMake(GoodMake.subOrder.id, "步骤【" + key + "】准备下发物料:" + RecipesNames, count, key, false); | 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++) { | for (int m = 0; m < goodsRecipes.size(); m++) { | ||||
ResGoodsRecipe recipe = goodsRecipes.get(m); | ResGoodsRecipe recipe = goodsRecipes.get(m); | ||||
final String message = "[" + GoodMake.good.name + "]步骤【" + key + "】下发【" + recipe.materialName + "】"; | final String message = "[" + GoodMake.good.name + "]步骤【" + key + "】下发【" + recipe.materialName + "】"; | ||||
//获取物料关联的料仓信息 | //获取物料关联的料仓信息 | ||||
BPA_SILOS silos = null; | BPA_SILOS silos = null; | ||||
List<BPA_SILOS> siloslist = QueryDB.GetSolisByMaterialID(recipe.materialID); | List<BPA_SILOS> siloslist = QueryDB.GetSolisByMaterialID(recipe.materialID); | ||||
@@ -349,23 +344,12 @@ public class ExecuteTheRecipe { | |||||
if (silos == null) { | if (silos == null) { | ||||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "下发失败!物料没有管理料仓!"); | MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "下发失败!物料没有管理料仓!"); | ||||
} else { | } 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)); | 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 | //endregion | ||||
//等待配料完成,一直等待 | //等待配料完成,一直等待 | ||||
@@ -415,7 +399,7 @@ public class ExecuteTheRecipe { | |||||
ToastUtils.error("异常信息:" + ex.getMessage()); | ToastUtils.error("异常信息:" + ex.getMessage()); | ||||
IsMakeGood=false; | IsMakeGood=false; | ||||
} | } | ||||
Thread.sleep(500); | |||||
Thread.sleep(100); | |||||
} | } | ||||
@Override | @Override | ||||
public void RunComplete() throws InterruptedException { | public void RunComplete() throws InterruptedException { | ||||
@@ -122,6 +122,7 @@ public class DataBus { | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
ExecuteTheRecipe.MakeGoodCount++; | |||||
ArrayList<String> suorderlist=new ArrayList<>(); | ArrayList<String> suorderlist=new ArrayList<>(); | ||||
for (ResGoodsMake item:GoodsMake) | for (ResGoodsMake item:GoodsMake) | ||||
{ | { | ||||
@@ -172,7 +173,7 @@ public class DataBus { | |||||
make.makeMs="等待下发物料!"; | make.makeMs="等待下发物料!"; | ||||
make.makeProcess=0; | make.makeProcess=0; | ||||
GoodsMake.add(make); | GoodsMake.add(make); | ||||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + make.good.name + "]准备配料!"); | |||||
// MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + make.good.name + "]准备配料!"); | |||||
if(loadinggoodAdapter!=null) | if(loadinggoodAdapter!=null) | ||||
{ | { | ||||
@@ -308,6 +309,7 @@ public class DataBus { | |||||
//region 流速校验 | //region 流速校验 | ||||
public ArrayList<SilosLsjyMode> SilosLsjy = new ArrayList<SilosLsjyMode>(); | public ArrayList<SilosLsjyMode> SilosLsjy = new ArrayList<SilosLsjyMode>(); | ||||
public lsjy_adapter lsjyAdapter=null; | |||||
/** | /** | ||||
* 获取流速料仓数据 | * 获取流速料仓数据 | ||||
*/ | */ | ||||
@@ -320,8 +322,8 @@ public class DataBus { | |||||
//加载materials数据 | //加载materials数据 | ||||
if (bpa_silos.size() > 0) { | 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) { | for (BPA_SILOS silo : bpa_silos) { | ||||
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | ||||
@@ -330,19 +332,43 @@ public class DataBus { | |||||
mode.name= silo.name; | mode.name= silo.name; | ||||
mode.materialName=m.size() > 0?m.get(0).name:"未设置"; | mode.materialName=m.size() > 0?m.get(0).name:"未设置"; | ||||
//mode.xs= ExecuteTheRecipe.getCalibrationValueXS(silo.num)+""; | //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); | SilosLsjy.add(mode); | ||||
} | } | ||||
} | } | ||||
if (DataBus.getInstance().lsjyAdapter!=null) | |||||
{ | |||||
DataBus.getInstance().lsjyAdapter.refresh(); | |||||
} | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
e.printStackTrace(); | 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 | //endregion | ||||
//region 温度设置 | //region 温度设置 | ||||
@@ -367,8 +393,8 @@ public class DataBus { | |||||
wdszMode mode=new wdszMode(); | wdszMode mode=new wdszMode(); | ||||
mode.name=item; | mode.name=item; | ||||
mode.temp=0; | 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; | mode.autoheat=false; | ||||
if(item.equals("水池温度")) | if(item.equals("水池温度")) | ||||
{ | { | ||||
@@ -390,6 +416,19 @@ public class DataBus { | |||||
e.printStackTrace(); | 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 | //endregion | ||||
//region 自动清洗 | //region 自动清洗 | ||||
@@ -179,8 +179,8 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||||
@Override | @Override | ||||
public void run() { | public void run() { | ||||
try { | try { | ||||
wdszModes.clear(); | |||||
wdszModes = DataBus.getInstance().wdszModes; | |||||
// wdszModes.clear(); | |||||
// wdszModes = DataBus.getInstance().wdszModes; | |||||
notifyDataSetChanged(); | notifyDataSetChanged(); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
@@ -14,16 +14,17 @@ import androidx.annotation.Nullable; | |||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.common.db.res.ResAlertLog; | import com.bonait.bnframework.common.db.res.ResAlertLog; | ||||
import com.bonait.bnframework.common.db.res.ResLog; | |||||
import java.util.List; | 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 Context context; | ||||
private int resource; | 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); | super(context, resource, objects); | ||||
this.context = context; | this.context = context; | ||||
this.resource=resource; | this.resource=resource; | ||||
@@ -33,7 +34,7 @@ public class yjrz_adapter extends ArrayAdapter<ResAlertLog> { | |||||
@NonNull | @NonNull | ||||
@Override | @Override | ||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { | 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); | View view = LayoutInflater.from(getContext()).inflate(this.resource, parent, false); | ||||
//分别获取 image view 和 textview 的实例 | //分别获取 image view 和 textview 的实例 | ||||
@@ -46,13 +47,19 @@ public class yjrz_adapter extends ArrayAdapter<ResAlertLog> { | |||||
switch (log.type) | switch (log.type) | ||||
{ | { | ||||
case 1: | case 1: | ||||
type.setText("异常订单未制作日志"); | |||||
type.setText("登录日志"); | |||||
break; | break; | ||||
case 2: | case 2: | ||||
type.setText("料仓缺料日志"); | |||||
type.setText("角色操作日志"); | |||||
break; | break; | ||||
case 3: | case 3: | ||||
type.setText("传感器异常日志"); | |||||
type.setText("数据接收"); | |||||
break; | |||||
case 4: | |||||
type.setText("上传日志"); | |||||
break; | |||||
case 5: | |||||
type.setText("订单处理日志"); | |||||
break; | break; | ||||
} | } | ||||
time.setText(log.createTime); | time.setText(log.createTime); | ||||
@@ -265,6 +265,12 @@ public class MakeGoodFragment extends BaseFragment { | |||||
return; | return; | ||||
} | } | ||||
if (!clk) | |||||
{ | |||||
ToastUtils.warning("出料口没有检测到器皿!"); | |||||
return; | |||||
} | |||||
//判断温度是否到达 | //判断温度是否到达 | ||||
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | ||||
{ | { | ||||
@@ -402,6 +408,7 @@ public class MakeGoodFragment extends BaseFragment { | |||||
int gt1wd=0; | int gt1wd=0; | ||||
int gt2wd=0; | int gt2wd=0; | ||||
boolean clk=false; | |||||
/** | /** | ||||
* 实时显示线程 | * 实时显示线程 | ||||
@@ -420,6 +427,8 @@ public class MakeGoodFragment extends BaseFragment { | |||||
{ | { | ||||
zhongliangxianshi=String.valueOf((int)obj / 10.0) + " g"; | zhongliangxianshi=String.valueOf((int)obj / 10.0) + " g"; | ||||
} | } | ||||
Object obj122= ExecuteTheRecipe.ReadPLC("出料口检测"); | |||||
clk=obj122==null?false:(boolean) obj122; | |||||
Object obj1= ExecuteTheRecipe.ReadPLC("水池温度"); | Object obj1= ExecuteTheRecipe.ReadPLC("水池温度"); | ||||
if(obj1!=null) | if(obj1!=null) | ||||
@@ -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_GOODSTYPE; | ||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | ||||
import com.bonait.bnframework.common.db.res.ResGoodProperty; | 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.db.res.lcMode; | ||||
import com.bonait.bnframework.common.helper.I.IRunT; | import com.bonait.bnframework.common.helper.I.IRunT; | ||||
import com.bonait.bnframework.common.helper.I.MyClickListener; | 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; | private Context context; | ||||
@@ -145,17 +146,16 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
setContentView(R.layout.activity_goodpeifang); | setContentView(R.layout.activity_goodpeifang); | ||||
ButterKnife.bind(this); | ButterKnife.bind(this); | ||||
activity=this; | |||||
activity = this; | |||||
context = getContext(); | context = getContext(); | ||||
initTopBar(); | initTopBar(); | ||||
Initdata(); | Initdata(); | ||||
} | } | ||||
private void initTopBar() { | private void initTopBar() { | ||||
mTopBar.setTitle("商品配方管理"); | 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 | @Override | ||||
public void onClick(View view) { | public void onClick(View view) { | ||||
finish(); | finish(); | ||||
@@ -166,8 +166,8 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onMessage(Object msg) { | public void onMessage(Object msg) { | ||||
if (msg != null) { | 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); | add_good.setVisibility(View.VISIBLE); | ||||
} | } | ||||
} | } | ||||
@@ -177,7 +177,18 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onMessage(Object msg) { | public void onMessage(Object msg) { | ||||
if (msg != null) { | 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); | QueryDB.DeleteGoods(xx); | ||||
Initdata(); | Initdata(); | ||||
ToastUtils.info("删除成功!!!"); | ToastUtils.info("删除成功!!!"); | ||||
@@ -190,79 +201,86 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onMessage(Object msg) { | public void onMessage(Object msg) { | ||||
if (msg != null) { | 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_pf_home.setVisibility(View.VISIBLE); | ||||
} | } | ||||
} | } | ||||
}); | }); | ||||
//增加商品 | //增加商品 | ||||
add_good.mListener=new MyClickListener() { | |||||
add_good.mListener = new MyClickListener() { | |||||
@Override | @Override | ||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
} | } | ||||
@Override | @Override | ||||
public void clickListenerNew(View v, int k, Object data) { | public void clickListenerNew(View v, int k, Object data) { | ||||
if(k==0) | |||||
{ | |||||
if (k == 0) { | |||||
add_good.setVisibility(View.GONE); | add_good.setVisibility(View.GONE); | ||||
}else | |||||
{ | |||||
} else if (k == 1) { | |||||
Initdata(); | Initdata(); | ||||
ToastUtils.info("执行成功!!!"); | ToastUtils.info("执行成功!!!"); | ||||
add_good.setVisibility(View.GONE); | 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 | @Override | ||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
} | } | ||||
@Override | @Override | ||||
public void clickListenerNew(View v, int k, Object data) { | public void clickListenerNew(View v, int k, Object data) { | ||||
if(k==0) | |||||
{ | |||||
if (k == 0) { | |||||
add_pf_home.setVisibility(View.GONE); | add_pf_home.setVisibility(View.GONE); | ||||
}else if(k==1) | |||||
{ | |||||
} else if (k == 1) { | |||||
//新建配方 | //新建配方 | ||||
add_pf_home.setVisibility(View.GONE); | 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.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); | 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.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 | @Override | ||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
} | } | ||||
@Override | @Override | ||||
public void clickListenerNew(View v, int k, Object data) { | 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); | add_pf.setVisibility(View.GONE); | ||||
ToastUtils.info("保存成功!!!"); | |||||
}else | }else | ||||
{ | { | ||||
add_pf.setVisibility(View.GONE); | |||||
ToastUtils.info("保存成功!!!"); | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
@@ -273,34 +291,32 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
*/ | */ | ||||
ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>(); | ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>(); | ||||
public List<LinkMode> Fdata = new ArrayList<>(); | public List<LinkMode> Fdata = new ArrayList<>(); | ||||
/** | /** | ||||
* 初始化数据 | * 初始化数据 | ||||
*/ | */ | ||||
public void Initdata() | |||||
{ | |||||
public void Initdata() { | |||||
bpa_goodproperties.clear(); | bpa_goodproperties.clear(); | ||||
ArrayList<BPA_GOODPROPERTY> da = QueryDB.GetGoodsPropertyALL("0"); | 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<>(); | 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); | _chid.add(m); | ||||
} | } | ||||
re.child=_chid; | |||||
re.child = _chid; | |||||
bpa_goodproperties.add(re); | bpa_goodproperties.add(re); | ||||
} | } | ||||
@@ -311,17 +327,16 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
Fdata.clear(); | 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++; | i++; | ||||
} | } | ||||
LinearLayoutManager manager = (LinearLayoutManager) rv_right.getLayoutManager(); | 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_left.setAdapter(leftAdapter); | ||||
rv_right.setAdapter(rightAdapter); | rv_right.setAdapter(rightAdapter); | ||||
@@ -332,8 +347,7 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
typeListener.add(((BPA_GOODSTYPE) item.type).name); | typeListener.add(((BPA_GOODSTYPE) item.type).name); | ||||
} | } | ||||
if(rv_right.getItemDecorationCount()>0) | |||||
{ | |||||
if (rv_right.getItemDecorationCount() > 0) { | |||||
rv_right.removeItemDecorationAt(0); | rv_right.removeItemDecorationAt(0); | ||||
} | } | ||||
TopItemDecoration top = new TopItemDecoration(context, typeListener); | 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) { | public void onViewClicked(View view) { | ||||
switch (view.getId()) { | switch (view.getId()) { | ||||
case R.id.add_fl://增加分类 | case R.id.add_fl://增加分类 | ||||
@@ -395,7 +409,7 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
.show(); | .show(); | ||||
break; | break; | ||||
case R.id.add_sp://增加商品 | case R.id.add_sp://增加商品 | ||||
add_good.setData("新建",null,goodstypes,activity); | |||||
add_good.setData("保存", null, goodstypes, activity); | |||||
add_good.setVisibility(View.VISIBLE); | add_good.setVisibility(View.VISIBLE); | ||||
break; | break; | ||||
} | } | ||||
@@ -26,6 +26,7 @@ import com.bonait.bnframework.common.base.BaseFragment; | |||||
import com.bonait.bnframework.common.constant.ConfigName; | import com.bonait.bnframework.common.constant.ConfigName; | ||||
import com.bonait.bnframework.common.db.QueryDB; | import com.bonait.bnframework.common.db.QueryDB; | ||||
import com.bonait.bnframework.common.db.res.ResAlertLog; | 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.helper.DateUtils; | ||||
import com.bonait.bnframework.common.utils.ToastUtils; | import com.bonait.bnframework.common.utils.ToastUtils; | ||||
import com.bonait.bnframework.modules.home.adapter.yjrz_adapter; | 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(){ | private void Init(){ | ||||
lx_map.put("全部日志",0); | 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())); | ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(lx_map.keySet())); | ||||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | ||||
rzlx.setAdapter(adapter2); | rzlx.setAdapter(adapter2); | ||||
@@ -210,7 +215,7 @@ public class LogActivity extends BaseActivity { | |||||
} | } | ||||
String lx= rzlx.getSelectedItem().toString(); | String lx= rzlx.getSelectedItem().toString(); | ||||
String text= edittext.getText().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); | adapter = new yjrz_adapter(context,R.layout.yjrz_item,bpa_logs); | ||||
datatab.setAdapter(adapter); | datatab.setAdapter(adapter); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
@@ -239,6 +239,12 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
return; | return; | ||||
} | } | ||||
if (!clk) | |||||
{ | |||||
ToastUtils.warning("出料口没有检测到器皿!"); | |||||
return; | |||||
} | |||||
//region 判断是否只勾选了一个料仓 | //region 判断是否只勾选了一个料仓 | ||||
SelectSilos(); | SelectSilos(); | ||||
//endregion | //endregion | ||||
@@ -297,7 +303,6 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
//endregion | //endregion | ||||
} | } | ||||
//region 数据加载 | //region 数据加载 | ||||
public lsjy_adapter lsjyAdapter=null; | |||||
/** | /** | ||||
* 初始化数据加载 | * 初始化数据加载 | ||||
*/ | */ | ||||
@@ -309,9 +314,6 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
public void run() { | public void run() { | ||||
try { | try { | ||||
DataBus.getInstance().GetSilosLsjy(); | DataBus.getInstance().GetSilosLsjy(); | ||||
//底部按钮信息 | |||||
Object obj= ExecuteTheRecipe.ReadPLC("基准时间"); | |||||
String time = obj==null?"0":obj.toString(); | |||||
getActivity().runOnUiThread(new Runnable() { | getActivity().runOnUiThread(new Runnable() { | ||||
@Override | @Override | ||||
public void run() { | public void run() { | ||||
@@ -319,10 +321,28 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
if(isAdded()) | if(isAdded()) | ||||
{ | { | ||||
Recy_Lsjy.setLayoutManager(new WrapContentLinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL,false)); | 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))); | edittext_jzsj.setText(String.format("%.1f", (Double.parseDouble(time) / 10))); | ||||
if (ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | if (ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | ||||
@@ -365,6 +385,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
} | } | ||||
}; | }; | ||||
int zhongliangxianshi=0; | int zhongliangxianshi=0; | ||||
boolean clk=false; | |||||
int gt1wd=0; | int gt1wd=0; | ||||
int gt2wd=0; | int gt2wd=0; | ||||
/** | /** | ||||
@@ -377,12 +398,16 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
while (ConfigName.getInstance().PlcIsConnect) { | while (ConfigName.getInstance().PlcIsConnect) { | ||||
try { | try { | ||||
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量"); | Object obj= ExecuteTheRecipe.ReadPLC("称当前重量"); | ||||
Object obj1= ExecuteTheRecipe.ReadPLC("出料口检测"); | |||||
if(obj!=null) | if(obj!=null) | ||||
{ | { | ||||
zhongliangxianshi=(int)obj;// | zhongliangxianshi=(int)obj;// | ||||
mHandler.sendEmptyMessage(0); | mHandler.sendEmptyMessage(0); | ||||
} | } | ||||
clk=obj1==null?false:(boolean) obj1; | |||||
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | ||||
{ | { | ||||
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度"); | Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度"); | ||||
@@ -426,9 +451,9 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
ToastUtils.warning("重量!" +item.Value); | ToastUtils.warning("重量!" +item.Value); | ||||
} | } | ||||
} | } | ||||
if (lsjyAdapter!=null) | |||||
if (DataBus.getInstance().lsjyAdapter!=null) | |||||
{ | { | ||||
lsjyAdapter.refresh(); | |||||
DataBus.getInstance().lsjyAdapter.refresh(); | |||||
} | } | ||||
} | } | ||||
}, 2000); | }, 2000); | ||||
@@ -454,7 +479,16 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
Logger.d("我的fragment销毁"); | Logger.d("我的fragment销毁"); | ||||
ExecuteTheRecipe.WritePLC("手自切换", true, null); | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
try { | |||||
ExecuteTheRecipe.WritePLC("手自切换", true, null); | |||||
} catch (Exception e) { | |||||
} | |||||
} | |||||
}).start(); | |||||
} | } | ||||
/** | /** | ||||
@@ -86,14 +86,13 @@ public class JiaoYan_wdsz_fragment extends BaseFragment { | |||||
} | } | ||||
}); | }); | ||||
DataBus.getInstance().GetWD(); | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
} | } | ||||
} | } | ||||
}).start(); | }).start(); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
} | } | ||||
@@ -16,6 +16,7 @@ import com.bonait.bnframework.business.ConfigData; | |||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | import com.bonait.bnframework.business.ExecuteTheRecipe; | ||||
import com.bonait.bnframework.common.base.BaseFragment; | import com.bonait.bnframework.common.base.BaseFragment; | ||||
import com.bonait.bnframework.common.constant.ConfigName; | import com.bonait.bnframework.common.constant.ConfigName; | ||||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||||
import com.bonait.bnframework.common.utils.ToastUtils; | import com.bonait.bnframework.common.utils.ToastUtils; | ||||
import com.orhanobut.logger.Logger; | import com.orhanobut.logger.Logger; | ||||
import com.suke.widget.SwitchButton; | import com.suke.widget.SwitchButton; | ||||
@@ -81,6 +82,17 @@ public class JiaoYan_zdbs_fragment extends BaseFragment { | |||||
{ | { | ||||
ConfigName.getInstance().AutomaticWaterRefillTime=edittext_ycsj.getText().toString(); | ConfigName.getInstance().AutomaticWaterRefillTime=edittext_ycsj.getText().toString(); | ||||
ConfigData.getInstance().SavePZ(); | 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("保存成功!"); | ToastUtils.info("保存成功!"); | ||||
} | } | ||||
} | } | ||||
@@ -110,7 +122,6 @@ public class JiaoYan_zdbs_fragment extends BaseFragment { | |||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
Logger.d("我的fragment销毁"); | Logger.d("我的fragment销毁"); | ||||
ExecuteTheRecipe.WritePLC("清洗模式",false,null); | |||||
} | } | ||||
/** | /** | ||||
@@ -278,7 +278,16 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { | |||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
Logger.d("我的fragment销毁"); | Logger.d("我的fragment销毁"); | ||||
ExecuteTheRecipe.WritePLC("清洗模式",false,null); | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
try { | |||||
ExecuteTheRecipe.WritePLC("清洗模式",false,null); | |||||
} catch (Exception e) { | |||||
} | |||||
} | |||||
}).start(); | |||||
} | } | ||||
/** | /** | ||||
@@ -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 ImageView cpfm; | ||||
public EditText edittext,edittext1; | 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() { | close_from.setOnClickListener(new View.OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View v) { | public void onClick(View v) { | ||||
@@ -227,7 +275,7 @@ public class add_good_control extends LinearLayout { | |||||
private void initView() { | private void initView() { | ||||
close_from = (Button) findViewById(R.id.close_from); | close_from = (Button) findViewById(R.id.close_from); | ||||
xinjian = (Button) findViewById(R.id.xinjian); | xinjian = (Button) findViewById(R.id.xinjian); | ||||
save_xinjian= (Button) findViewById(R.id.save_xinjian); | |||||
cpfm = findViewById(R.id.cpfm); | cpfm = findViewById(R.id.cpfm); | ||||
edittext = findViewById(R.id.edittext); | edittext = findViewById(R.id.edittext); | ||||
@@ -53,6 +53,8 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||||
@BindView(R.id.peifang_queren) | @BindView(R.id.peifang_queren) | ||||
Button peifang_queren; | Button peifang_queren; | ||||
@BindView(R.id.save_peifang_queren) | |||||
Button save_peifang_queren; | |||||
@BindView(R.id.close_from) | @BindView(R.id.close_from) | ||||
Button close_from; | Button close_from; | ||||
@@ -231,6 +233,15 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||||
edittext.setText(""); | edittext.setText(""); | ||||
} | } | ||||
if(bpaGoodsrecipename==null)//新增 | |||||
{ | |||||
save_peifang_queren.setVisibility(View.VISIBLE); | |||||
}else | |||||
{ | |||||
save_peifang_queren.setVisibility(View.GONE); | |||||
} | |||||
title.setText(Good.name+""); | title.setText(Good.name+""); | ||||
initData(); | initData(); | ||||
}catch (Exception ex) | }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() { | close_from.setOnClickListener(new View.OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View v) { | 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; | return true; | ||||
} | } | ||||
@@ -63,8 +63,11 @@ public class sdkz_control extends LinearLayout { | |||||
aSwitch.setTag(item.zd_address); | aSwitch.setTag(item.zd_address); | ||||
// aSwitch.setChecked(ExecuteTheRecipe.ReadPLCSD(item.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() { | aSwitch.setOnClickListener(new OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View view) { | public void onClick(View view) { | ||||
@@ -81,6 +84,13 @@ public class sdkz_control extends LinearLayout { | |||||
} | } | ||||
} | } | ||||
}).start(); | }).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); | ToastUtils.info(aSwitch.getText().toString()+",地址:"+addr+".状态:"+isopen); | ||||
} | } | ||||
}); | }); | ||||
@@ -79,19 +79,19 @@ | |||||
</RelativeLayout> | </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> | </com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -58,6 +58,14 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="wrap_content"> | 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 | <Button | ||||
android:id="@+id/add_sp" | android:id="@+id/add_sp" | ||||
android:layout_width="100dp" | android:layout_width="100dp" | ||||
@@ -48,7 +48,7 @@ | |||||
<TextView | <TextView | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:text="输入砝码重量" | |||||
android:text="请先在称上放入砝码后\n文本框输入砝码重量" | |||||
android:textAlignment="center" /> | android:textAlignment="center" /> | ||||
<EditText | <EditText | ||||
android:layout_marginTop="@dimen/dp_10" | android:layout_marginTop="@dimen/dp_10" | ||||
@@ -70,7 +70,7 @@ | |||||
</LinearLayout> | </LinearLayout> | ||||
<LinearLayout | <LinearLayout | ||||
android:layout_width="300dp" | |||||
android:layout_width="260dp" | |||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:orientation="vertical" | android:orientation="vertical" | ||||
android:layout_marginBottom="35dp"> | android:layout_marginBottom="35dp"> | ||||
@@ -174,16 +174,30 @@ | |||||
</LinearLayout> | </LinearLayout> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
<Button | |||||
<LinearLayout | |||||
android:layout_alignParentBottom="true" | 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: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> | ||||
</RelativeLayout> | </RelativeLayout> |
@@ -232,17 +232,31 @@ | |||||
</LinearLayout> | </LinearLayout> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
<Button | |||||
<LinearLayout | |||||
android:layout_alignParentBottom="true" | 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: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> | ||||
</RelativeLayout> | </RelativeLayout> |
@@ -29,20 +29,21 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="match_parent"> | android:layout_height="match_parent"> | ||||
<TextView | <TextView | ||||
android:id="@+id/loading_xuhao" | android:id="@+id/loading_xuhao" | ||||
android:layout_marginLeft="20dp" | |||||
android:layout_centerInParent="true" | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_centerInParent="true" | |||||
android:layout_marginLeft="10dp" | |||||
android:text="01" | android:text="01" | ||||
android:textColor="@color/text4" | |||||
android:textSize="19dp" | android:textSize="19dp" | ||||
android:textStyle="bold" | |||||
android:textColor="@color/text4"></TextView> | |||||
android:textStyle="bold"></TextView> | |||||
</RelativeLayout> | </RelativeLayout> | ||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_marginLeft="10dp" | |||||
android:layout_marginLeft="0dp" | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="match_parent"> | android:layout_height="match_parent"> | ||||
<LinearLayout | <LinearLayout | ||||
@@ -71,8 +72,8 @@ | |||||
android:id="@+id/loading_time" | android:id="@+id/loading_time" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="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"/> | android:textColor="@color/tab_text_normal"/> | ||||
</LinearLayout> | </LinearLayout> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
@@ -1,8 +1,8 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
xmlns:tools="http://schemas.android.com/tools" | 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_marginTop="@dimen/dp_10" | ||||
android:layout_marginLeft="@dimen/dp_10" | android:layout_marginLeft="@dimen/dp_10" | ||||
android:layout_marginBottom="@dimen/dp_10" | android:layout_marginBottom="@dimen/dp_10" | ||||
android:layout_marginRight="@dimen/dp_10" | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:orientation="vertical" | android:orientation="vertical" | ||||
@@ -19,7 +18,7 @@ | |||||
android:id="@+id/ImageUrl" | android:id="@+id/ImageUrl" | ||||
android:layout_margin="5dp" | android:layout_margin="5dp" | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="110dp" | |||||
android:layout_height="90dp" | |||||
android:src="@mipmap/loading3" | android:src="@mipmap/loading3" | ||||
android:scaleType="fitXY" | android:scaleType="fitXY" | ||||
/> | /> | ||||
@@ -40,7 +39,7 @@ | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_marginLeft="10dp" | android:layout_marginLeft="10dp" | ||||
android:textSize="12dp" | |||||
android:textSize="16dp" | |||||
android:textColor="@color/light_blue_primary" | android:textColor="@color/light_blue_primary" | ||||
android:text="修改"/> | android:text="修改"/> | ||||
<TextView | <TextView | ||||
@@ -48,7 +47,7 @@ | |||||
android:layout_marginRight="20dp" | android:layout_marginRight="20dp" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:textSize="12dp" | |||||
android:textSize="16dp" | |||||
android:layout_alignParentRight="true" | android:layout_alignParentRight="true" | ||||
android:textColor="@color/red_primary_dark" | android:textColor="@color/red_primary_dark" | ||||
android:text="删除"/> | android:text="删除"/> | ||||
@@ -1,8 +1,8 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
xmlns:tools="http://schemas.android.com/tools" | 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:id="@+id/ImageUrl" | ||||
android:layout_margin="5dp" | android:layout_margin="5dp" | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="110dp" | |||||
android:layout_height="100dp" | |||||
android:src="@mipmap/loading3" | android:src="@mipmap/loading3" | ||||
android:scaleType="fitXY" | android:scaleType="fitXY" | ||||
/> | /> | ||||