|
|
|
@ -166,8 +166,8 @@ int bs_sap_material(EPM_action_message_t msg) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void get_bom(System::Collections::Generic::List<System::Collections::Generic::Dictionary<String^, String^>^> ^a_list,tag_t line,char *werks,char *stlan,string pid, tag_t relation_type,boolean is_hl,boolean is_judge,vector<string> &bom_ids)
|
|
|
|
|
{ int line_cnt;
|
|
|
|
|
void get_bom(System::Collections::Generic::List<System::Collections::Generic::Dictionary<String^, String^>^> ^a_list, tag_t line, char *werks, char *stlan, string pid, tag_t relation_type, boolean is_hl, boolean is_judge, vector<string> &bom_ids) {
|
|
|
|
|
int line_cnt;
|
|
|
|
|
tag_t *lines;
|
|
|
|
|
BOM_line_ask_child_lines(line, &line_cnt, &lines);
|
|
|
|
|
char *id;
|
|
|
|
@ -175,11 +175,10 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
|
|
|
|
|
if (find(bom_ids.begin(), bom_ids.end(), id) != bom_ids.end())
|
|
|
|
|
return;
|
|
|
|
|
bom_ids.push_back(id);
|
|
|
|
|
if(a_list->Count==0)
|
|
|
|
|
{
|
|
|
|
|
pid = pid.length()>0?pid:id; int index = pid.find('-');
|
|
|
|
|
if (a_list->Count == 0) {
|
|
|
|
|
pid = pid.length() > 0 ? pid : id; int index = pid.find('-');
|
|
|
|
|
if (index != -1)
|
|
|
|
|
pid = pid.substr(0,index);
|
|
|
|
|
pid = pid.substr(0, index);
|
|
|
|
|
}
|
|
|
|
|
for (int j = 0; j < line_cnt; j++) {
|
|
|
|
|
System::Collections::Generic::Dictionary<String^, String^> ^dic = gcnew System::Collections::Generic::Dictionary<String^, String^>();
|
|
|
|
@ -191,7 +190,7 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
|
|
|
|
|
dic["POSTP"] = "L";
|
|
|
|
|
char *val;
|
|
|
|
|
AOM_UIF_ask_value(lines[j], "bl_sequence_no", &val);
|
|
|
|
|
if(!is_judge)
|
|
|
|
|
if (!is_judge)
|
|
|
|
|
dic["POSNR"] = convert_to_cstring(val);
|
|
|
|
|
char *child_id;
|
|
|
|
|
AOM_UIF_ask_value(lines[j], "bl_child_id", &child_id);
|
|
|
|
@ -219,8 +218,8 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
|
|
|
|
|
AOM_ask_value_string(lines[j], "JD2_sl", &val);
|
|
|
|
|
quantity = val;
|
|
|
|
|
int index = quantity.find('.');
|
|
|
|
|
if(index!=-1&&quantity.length()>(index + 4))
|
|
|
|
|
{ quantity = quantity.substr(0,index + 4);
|
|
|
|
|
if (index != -1 && quantity.length() > (index + 4)) {
|
|
|
|
|
quantity = quantity.substr(0, index + 4);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
AOM_ask_value_string(lines[j], "bl_quantity", &val);
|
|
|
|
@ -263,7 +262,7 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
|
|
|
|
|
} 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,bom_ids);
|
|
|
|
|
get_bom(a_list, lines[j], werks, stlan, pid.length() > 0 ? pid : id, relation_type, child_is_hl, is_judge, bom_ids);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// if (tc_strcmp(val1, "F") == 0 && tc_strlen(val2) == 0)
|
|
|
|
@ -274,7 +273,7 @@ get_bom(a_list, lines[j], werks, stlan, pid.length()>0 ? pid : id, relation_type
|
|
|
|
|
}
|
|
|
|
|
a_list->Add(dic);
|
|
|
|
|
|
|
|
|
|
get_bom(a_list, lines[j], werks, stlan,"",relation_type, child_is_hl, is_judge,bom_ids);
|
|
|
|
|
get_bom(a_list, lines[j], werks, stlan, "", relation_type, child_is_hl, is_judge, bom_ids);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -325,10 +324,9 @@ int bs_sap_bom(EPM_action_message_t msg) {
|
|
|
|
|
}
|
|
|
|
|
printf("has _99:%d\n", has_99);
|
|
|
|
|
vector<string> bom_ids;
|
|
|
|
|
for (int i = 0; i < att_count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (isTypeOf(attachments[i], "PSBOMViewRevision"))
|
|
|
|
|
{ printf("execute\n");
|
|
|
|
|
for (int i = 0; i < att_count; i++) {
|
|
|
|
|
if (isTypeOf(attachments[i], "PSBOMViewRevision")) {
|
|
|
|
|
printf("execute\n");
|
|
|
|
|
int rel_cnt, line_cnt;
|
|
|
|
|
System::Collections::Generic::List<System::Collections::Generic::Dictionary<String^, String^>^> ^a_list = gcnew System::Collections::Generic::List<System::Collections::Generic::Dictionary<String^, String^>^>();
|
|
|
|
|
tag_t top_line, *lines, rev, *rels;
|
|
|
|
@ -344,10 +342,9 @@ int bs_sap_bom(EPM_action_message_t msg) {
|
|
|
|
|
if (find(bom_ids.begin(), bom_ids.end(), id) != bom_ids.end())
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if(has_99)
|
|
|
|
|
{
|
|
|
|
|
if (id[0] != '9' || id[1] != '9')
|
|
|
|
|
{ printf("not 99:%s\n", id);
|
|
|
|
|
if (has_99) {
|
|
|
|
|
if (id[0] != '9' || id[1] != '9') {
|
|
|
|
|
printf("not 99:%s\n", id);
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -362,7 +359,7 @@ int bs_sap_bom(EPM_action_message_t msg) {
|
|
|
|
|
if (tc_strlen(werks) == 0 || tc_strlen(stlan) == 0)
|
|
|
|
|
continue;
|
|
|
|
|
boolean is_judege = id[0] == '9'&&id[1] == '9';
|
|
|
|
|
get_bom(a_list, top_line, werks, stlan,"", relation_type,is_hl,is_judege,bom_ids);
|
|
|
|
|
get_bom(a_list, top_line, werks, stlan, "", relation_type, is_hl, is_judege, bom_ids);
|
|
|
|
|
string result = ConvertToString(test->send_bom(url, user, password, a_list));
|
|
|
|
|
printf("result:%s\n", result.c_str());
|
|
|
|
|
if (result.length() && result[0] == 'E') {
|
|
|
|
|