Browse Source

第二代更新22

调味吧台(白底)
fyf 1 year ago
parent
commit
09806e73d5
5 changed files with 95 additions and 25 deletions
  1. +9
    -0
      app/src/main/java/com/example/bpa/Model/GyAction.java
  2. +4
    -0
      app/src/main/java/com/example/bpa/Model/PushDeviceGoods.java
  3. +11
    -0
      app/src/main/java/com/example/bpa/Model/TechnologyActions.java
  4. +11
    -4
      app/src/main/java/com/example/bpa/app/Main.java
  5. +60
    -21
      app/src/main/java/com/example/bpa/service/OrderServer.java

+ 9
- 0
app/src/main/java/com/example/bpa/Model/GyAction.java View File

@@ -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

}

+ 4
- 0
app/src/main/java/com/example/bpa/Model/PushDeviceGoods.java View File

@@ -22,4 +22,8 @@ public class PushDeviceGoods {
/// 配方绑定的工艺 /// 配方绑定的工艺
/// </summary> /// </summary>
public List<Batchingstechnology> Batchingstechnologys; public List<Batchingstechnology> Batchingstechnologys;
/**
* 商品工艺信息
*/
public List<TechnologyActions> TechnologyActions;
} }

+ 11
- 0
app/src/main/java/com/example/bpa/Model/TechnologyActions.java View File

@@ -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;//排序
}

+ 11
- 4
app/src/main/java/com/example/bpa/app/Main.java View File

@@ -269,10 +269,17 @@ public class Main {
public void UpdateVersion() public void UpdateVersion()
{ {
VersionMode mode=new VersionMode(); 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<VersionMode>().objectToJson(VersionMode.class, mode); String msg= new Json<VersionMode>().objectToJson(VersionMode.class, mode);
HttpUtils.httpPost(MessageName.UpdateVersion.name(),ConfigName.getInstance().UpdateVersion,msg); HttpUtils.httpPost(MessageName.UpdateVersion.name(),ConfigName.getInstance().UpdateVersion,msg);
} }


+ 60
- 21
app/src/main/java/com/example/bpa/service/OrderServer.java View File

@@ -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);
} }
} }
} }


Loading…
Cancel
Save