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

创建盘点任务

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