|
@@ -8,11 +8,13 @@ import com.example.bpa.Model.BPA_HeartPackage; |
|
|
import com.example.bpa.Model.BatchingsInfo; |
|
|
import com.example.bpa.Model.BatchingsInfo; |
|
|
import com.example.bpa.Model.Batchingstechnology; |
|
|
import com.example.bpa.Model.Batchingstechnology; |
|
|
import com.example.bpa.Model.GoodsBom; |
|
|
import com.example.bpa.Model.GoodsBom; |
|
|
|
|
|
import com.example.bpa.Model.GyAction; |
|
|
import com.example.bpa.Model.IMessage; |
|
|
import com.example.bpa.Model.IMessage; |
|
|
import com.example.bpa.Model.IRun; |
|
|
import com.example.bpa.Model.IRun; |
|
|
import com.example.bpa.Model.IThread; |
|
|
import com.example.bpa.Model.IThread; |
|
|
import com.example.bpa.Model.Message_HeartModel; |
|
|
import com.example.bpa.Model.Message_HeartModel; |
|
|
import com.example.bpa.Model.PushDeviceGoods; |
|
|
import com.example.bpa.Model.PushDeviceGoods; |
|
|
|
|
|
import com.example.bpa.Model.TechnologyActions; |
|
|
import com.example.bpa.config.ConfigName; |
|
|
import com.example.bpa.config.ConfigName; |
|
|
import com.example.bpa.db.QueryDB; |
|
|
import com.example.bpa.db.QueryDB; |
|
|
import com.example.bpa.db.mode.BPA_GOODS; |
|
|
import com.example.bpa.db.mode.BPA_GOODS; |
|
@@ -288,34 +290,71 @@ public class OrderServer { |
|
|
QueryDB.DeleteGoodsSrecipe(item); |
|
|
QueryDB.DeleteGoodsSrecipe(item); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ConcurrentHashMap<String,Batchingstechnology> 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<String,Batchingstechnology> 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<GyAction> gyActions= new Json<List<GyAction>>().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); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|