Commit 165fc08e authored by tank.li@mushiny.com's avatar tank.li@mushiny.com

创建盘点任务

parent ab95ed2b
......@@ -209,9 +209,11 @@ public class WMSService {
String orderId = CommonUtils.genUUID();
order.addKV("TASKID", orderId);
order.addKV("CREATED_DATE",new Date(System.currentTimeMillis()));
order.addKV("FACTORY",CommonUtils.parseString("FACTORY",data));
order.addKV("SECTION",CommonUtils.parseString("SECTION",data));
order.addKV("SECTION",CommonUtils.parseString("SECTION",data));
//order.addKV("FACTORY",CommonUtils.parseString("FACTORY",data));
order.addKV("WAREHOUSE_ID",CommonUtils.parseString("FACTORY",data));
order.addKV("SECTION_ID",CommonUtils.parseString("SECTION",data));
order.addKV("STATE",Sql_Table.AVAILABLE);
order.addKV("NEED_RESP", 0);
//"type":"all"
if(Objects.equals(CommonUtils.parseString("type", data), Sql_Table.ALL_TYPE)){
order.addKV("TYPE",Sql_Table.ALL_TYPE);
......@@ -239,14 +241,13 @@ public class WMSService {
}else{
//从 DATA选sku
order.addKV("TYPE",Sql_Table.SKU_TYPE);//两种类型
List<Map> skus = (List<Map>) data.get("DATA");
List<String> skus = (List<String>) data.get("DATA");
//查找所有存在盘点任务的SKU过滤
List<Map> allTaskingSKU = this.jdbcRepository.queryBySql(Sql_Table.SQL_ALL_TASKING_SKU,"Finish");
Set<String> allSku = this.list2Set(allTaskingSKU);
List exist = new ArrayList();
for (int i = 0; i < skus.size(); i++) {
Map row = skus.get(i);
String skuId = CommonUtils.parseString("SKUID",row);
String skuId = skus.get(i);
if(allSku.contains(skuId)){
logger.debug("SKU已存在盘点任务:" + skuId);
exist.add(skuId);
......@@ -259,8 +260,7 @@ public class WMSService {
}
//没有存在的盘点任务就生成
for (int i = 0; i < skus.size(); i++) {
Map row = skus.get(i);
String skuId = CommonUtils.parseString("SKUID",row);
String skuId = skus.get(i);
if(allSku.contains(skuId)){
logger.debug("SKU已存在盘点任务:" + skuId);
continue;
......@@ -268,7 +268,7 @@ public class WMSService {
BaseBpo baseBpo = new BaseBpo();
baseBpo.setTable(Sql_Table.WMS_ICQA_ORDERPOSITION);
baseBpo.addKV("ICQAID",orderId).addKV("ID",CommonUtils.genUUID())
.addKV("SKUID",CommonUtils.parseString("ID",row));
.addKV("SKUID",skuId);
this.jdbcRepository.insertBusinessObject(baseBpo);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment