From 77f0cb5e00f26d650929e283ceb3c6be8c0c3f98 Mon Sep 17 00:00:00 2001 From: liyf Date: Mon, 18 May 2020 10:13:19 +0800 Subject: [PATCH] 99 --- HEZON_ITK/bs_sap.cpp | 89 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 6 deletions(-) diff --git a/HEZON_ITK/bs_sap.cpp b/HEZON_ITK/bs_sap.cpp index 49f0246..2f0a761 100644 --- a/HEZON_ITK/bs_sap.cpp +++ b/HEZON_ITK/bs_sap.cpp @@ -108,12 +108,15 @@ int bs_sap_material(EPM_action_message_t msg) printf("revision get error\n"); continue; } + char *item_id; + AOM_ask_value_string(rev, "item_id", &item_id); // GRM_list_secondary_objects_only(attachments[i], relation_type, &rel_cnt, &rels); System::Collections::Generic::Dictionary ^dic = gcnew System::Collections::Generic::Dictionary(); for (auto j = prop_map.begin(); j != prop_map.end(); j++) { char *val=""; string temp_val; + if (j->second == "item_id") { AOM_ask_value_string(rev, j->second.c_str(), &val); @@ -234,15 +237,23 @@ void get_bom(System::Collections::Generic::List(index + 3)) + { + quantity = quantity.substr(0, index + 3); + } }else { AOM_ask_value_string(lines[j], "bl_quantity", &val); + quantity = val; } - dic["MENGE"] = convert_to_cstring(val); + dic["MENGE"] = convert_to_cstring(quantity.c_str()); if(is_judge){ if (rel_cnt) @@ -250,20 +261,50 @@ void get_bom(System::Collections::Generic::ListAdd(dic); continue; } if (tc_strcmp(val1, "F") == 0 && tc_strlen(val2) == 0) { + printf("has fempty:%s\n", obj_str); + a_list->Add(dic); + continue; + } + if (tc_strcmp(val1, "E") == 0 && tc_strlen(val2) == 0) + { + printf("has fempty:%s\n", obj_str); a_list->Add(dic); continue; } + if (tc_strcmp(val1, "E") == 0 && tc_strcmp(val2, "50") == 0) + { + printf("has e50:%s\n", obj_str); + + if(pid.length()>0) + { + printf("obj:%s pid:%s\n",obj_str,pid.c_str()); + }else + { + printf("obj:%s pid:%s\n", obj_str, id); + } + get_bom(a_list, lines[j], werks, stlan, pid.length()>0 ? pid : id, relation_type, child_is_hl, is_judge); + continue; + } + // if (tc_strcmp(val1, "F") == 0 && tc_strlen(val2) == 0) + // { + // a_list->Add(dic); + // continue; + // } } a_list->Add(dic); @@ -273,7 +314,7 @@ void get_bom(System::Collections::Generic::List