diff --git a/app/src/main/java/com/example/bpa/Model/GyAction.java b/app/src/main/java/com/example/bpa/Model/GyAction.java new file mode 100644 index 0000000..923696c --- /dev/null +++ b/app/src/main/java/com/example/bpa/Model/GyAction.java @@ -0,0 +1,9 @@ +package com.example.bpa.Model; + +public class GyAction { + public String TechnologyactionId ;//工艺id + public String ActionName ;//名称 + public int ActionValue ;//变量 + public String BatchingId ;//物料id + +} diff --git a/app/src/main/java/com/example/bpa/Model/PushDeviceGoods.java b/app/src/main/java/com/example/bpa/Model/PushDeviceGoods.java index 5c6e3ed..01fe28e 100644 --- a/app/src/main/java/com/example/bpa/Model/PushDeviceGoods.java +++ b/app/src/main/java/com/example/bpa/Model/PushDeviceGoods.java @@ -22,4 +22,8 @@ public class PushDeviceGoods { /// 配方绑定的工艺 /// public List Batchingstechnologys; + /** + * 商品工艺信息 + */ + public List TechnologyActions; } diff --git a/app/src/main/java/com/example/bpa/Model/TechnologyActions.java b/app/src/main/java/com/example/bpa/Model/TechnologyActions.java new file mode 100644 index 0000000..0ba8302 --- /dev/null +++ b/app/src/main/java/com/example/bpa/Model/TechnologyActions.java @@ -0,0 +1,11 @@ +package com.example.bpa.Model; + +public class TechnologyActions { + public String Id ; + public String StepName;//工艺名称 + public boolean IsBatch ;//是否批量处理 + public String BomId ;// 配方分类 id + public String ChnologyId ;//工艺模型id + public String ActionJson ;//信息json + public String Sort;//排序 +} diff --git a/app/src/main/java/com/example/bpa/app/Main.java b/app/src/main/java/com/example/bpa/app/Main.java index 7a4c161..c08a546 100644 --- a/app/src/main/java/com/example/bpa/app/Main.java +++ b/app/src/main/java/com/example/bpa/app/Main.java @@ -269,10 +269,17 @@ public class Main { public void UpdateVersion() { VersionMode mode=new VersionMode(); - mode.productCode="1668085292913659904"; - mode.moduleCode="naichaji"; - mode.serverCode="1668175205545807872"; - mode.branchCode="1668801915890962433"; + mode.productCode="1679307017135329280"; + mode.moduleCode="ncapp"; + mode.serverCode="1680767784879656960"; + mode.branchCode="1679307481578999809"; + + + //调味吧台 +// mode.productCode="1679307017135329280"; +// mode.moduleCode="twbt"; +// mode.serverCode="1680767784879656960"; +// mode.branchCode="1679309003247325185"; String msg= new Json().objectToJson(VersionMode.class, mode); HttpUtils.httpPost(MessageName.UpdateVersion.name(),ConfigName.getInstance().UpdateVersion,msg); } diff --git a/app/src/main/java/com/example/bpa/service/OrderServer.java b/app/src/main/java/com/example/bpa/service/OrderServer.java index 380ba58..1e4d49d 100644 --- a/app/src/main/java/com/example/bpa/service/OrderServer.java +++ b/app/src/main/java/com/example/bpa/service/OrderServer.java @@ -8,11 +8,13 @@ import com.example.bpa.Model.BPA_HeartPackage; import com.example.bpa.Model.BatchingsInfo; import com.example.bpa.Model.Batchingstechnology; import com.example.bpa.Model.GoodsBom; +import com.example.bpa.Model.GyAction; import com.example.bpa.Model.IMessage; import com.example.bpa.Model.IRun; import com.example.bpa.Model.IThread; import com.example.bpa.Model.Message_HeartModel; import com.example.bpa.Model.PushDeviceGoods; +import com.example.bpa.Model.TechnologyActions; import com.example.bpa.config.ConfigName; import com.example.bpa.db.QueryDB; import com.example.bpa.db.mode.BPA_GOODS; @@ -288,34 +290,71 @@ public class OrderServer { QueryDB.DeleteGoodsSrecipe(item); } - ConcurrentHashMap chnology=new ConcurrentHashMap<>(); - for(Batchingstechnology item:data.Batchingstechnologys) + if(data.TechnologyActions==null || data.TechnologyActions.size()<=0) { - if(!Info.containsKey(item.BomentryId)) - chnology.put(item.BomentryId,item); - } + ConcurrentHashMap chnology=new ConcurrentHashMap<>(); + for(Batchingstechnology item:data.Batchingstechnologys) + { + if(!Info.containsKey(item.BomentryId)) + chnology.put(item.BomentryId,item); + } - for(GoodsBom item:data.GoodsBomInfos) + for(GoodsBom item:data.GoodsBomInfos) + { + BPA_GOODSRECIPE da=new BPA_GOODSRECIPE(); + da.goodsID = item.GoodsId; + da.exp=item.BomName; + da.materialType =1; + da.deviceID = ConfigName.getInstance().DeviceId; + da.userID = ConfigName.getInstance().user.userID; + for (BatchingsInfo info: data.BatchingsInfos) + { + if(info.GoodsBomId.equals(item.GoodsBomId)) + { + da.id=info.Id; + Batchingstechnology gy= chnology.get(info.Id); + da.materialID = info.BatchingId; + da.value = (int)info.BomQty; + if(gy!=null) + { + da.sort =gy.Sort; + } + QueryDB.AddGoodsSrecipe(da); + } + } + } + }else { - BPA_GOODSRECIPE da=new BPA_GOODSRECIPE(); - da.goodsID = item.GoodsId; - da.exp=item.BomName; - da.materialType =1; - da.deviceID = ConfigName.getInstance().DeviceId; - da.userID = ConfigName.getInstance().user.userID; - for (BatchingsInfo info: data.BatchingsInfos) + for (TechnologyActions actions:data.TechnologyActions) { - if(info.GoodsBomId.equals(item.GoodsBomId)) + GoodsBom bom=null; + for(GoodsBom item:data.GoodsBomInfos) + { + if(item.BomId.equals(actions.BomId)) + { + bom=item; + } + } + if(bom!=null) { - da.id=info.Id; - Batchingstechnology gy= chnology.get(info.Id); - da.materialID = info.BatchingId; - da.value = (int)info.BomQty; - if(gy!=null) + BPA_GOODSRECIPE da=new BPA_GOODSRECIPE(); + da.goodsID = bom.GoodsId; + da.exp=bom.BomName; + da.materialType =1; + da.deviceID = ConfigName.getInstance().DeviceId; + da.userID = ConfigName.getInstance().user.userID; + if(!actions.ActionJson.isEmpty()) { - da.sort =gy.Sort; + List gyActions= new Json>().jsonToListobject(GyAction.class,((String)actions.ActionJson)); + for (GyAction a:gyActions) + { + da.id=java.util.UUID.randomUUID().toString(); + da.materialID = a.BatchingId; + da.value = a.ActionValue; + da.sort =Integer.parseInt(actions.Sort); + QueryDB.AddGoodsSrecipe(da); + } } - QueryDB.AddGoodsSrecipe(da); } } }