diff --git a/.gitignore b/.gitignore index f8e5cdb..f209ca6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # ---> C++ # Prerequisites *.d - +*.sdf # Compiled Object files *.slo *.lo @@ -15,7 +15,6 @@ # Compiled Dynamic libraries *.so *.dylib -*.dll # Fortran module files *.mod @@ -366,4 +365,5 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ -HEZON_ITK/HEZON_ITK.vcxproj + +HEZON_ITK/x64/ diff --git a/HEZON_ITK/bs_bom_check.cpp b/HEZON_ITK/bs_bom_check.cpp index a01490c..9c8c0fc 100644 --- a/HEZON_ITK/bs_bom_check.cpp +++ b/HEZON_ITK/bs_bom_check.cpp @@ -58,6 +58,13 @@ int bs_bom_check(EPM_rule_message_t msg) if (!pass) continue; printf("begin check \n"); + char *hl; + AOM_ask_value_string(attachments[i], "jd2_ishl", &hl); + printf("hl:%s\n", hl); + if(tc_strcmp(hl,"ÊÇ")==0) + { + continue; + } BOM_set_window_top_line(win, NULLTAG, attachments[i], NULLTAG, &top); AOM_UIF_ask_value(top, "jd2_last_release_status", &val); if (tc_strlen(val) && paras["status"].find(val) != -1) diff --git a/HEZON_ITK/bs_bom_save_check.cpp b/HEZON_ITK/bs_bom_save_check.cpp index 727e941..c02fa38 100644 --- a/HEZON_ITK/bs_bom_save_check.cpp +++ b/HEZON_ITK/bs_bom_save_check.cpp @@ -14,7 +14,13 @@ void save_judge(tag_t top, string &check, string &name, vector &type_vec continue; if (find(quantity_type_vec.begin(), quantity_type_vec.end(), val) != quantity_type_vec.end()) { - AOM_ask_value_string(lines[i], "bl_quantity", &val); + char *test; + AOM_ask_value_string(lines[i], "JD2_SFHL", &test); + printf("JD2_SFHL:%s\n", test); + if(tc_strcmp(test,"1")==0) + AOM_ask_value_string(lines[i], "JD2_sl", &val); + else + AOM_ask_value_string(lines[i], "bl_quantity", &val); if (tc_strlen(val) == 0) { AOM_ask_value_string(lines[i], "bl_rev_object_string", &val); diff --git a/HEZON_ITK/bs_sap.cpp b/HEZON_ITK/bs_sap.cpp index c2990a5..49f0246 100644 --- a/HEZON_ITK/bs_sap.cpp +++ b/HEZON_ITK/bs_sap.cpp @@ -35,8 +35,6 @@ int bs_sap_material(EPM_action_message_t msg) }else { class_map[1000 + i] = d0 + to_string(i + 1); - - } } @@ -174,6 +172,8 @@ int bs_sap_material(EPM_action_message_t msg) AOM_ask_value_string(rev, "item_id", &val); stringstream err; err << val << " ·¢ËÍ´íÎó:" << result; + POM_AM__set_application_bypass(false); + EMH_store_error_s1(EMH_severity_error, EMH_ATTR_error_base, err.str().c_str()); return 1; @@ -188,13 +188,20 @@ int bs_sap_material(EPM_action_message_t msg) } -void get_bom(System::Collections::Generic::List^> ^a_list,tag_t line,char *werks,char *stlan,string pid, tag_t relation_type) +void get_bom(System::Collections::Generic::List^> ^a_list,tag_t line,char *werks,char *stlan,string pid, tag_t relation_type,boolean is_hl,boolean is_judge) { int line_cnt; tag_t *lines; BOM_line_ask_child_lines(line, &line_cnt, &lines); char *id; AOM_UIF_ask_value(line, "bl_item_item_id", &id); + if(a_list->Count==0) + { + pid = pid.length()>0?pid:id; + int index = pid.find('-'); + if (index != -1) + pid = pid.substr(index + 1); + } for (int j = 0; j < line_cnt; j++) { System::Collections::Generic::Dictionary ^dic = gcnew System::Collections::Generic::Dictionary(); @@ -211,50 +218,62 @@ void get_bom(System::Collections::Generic::List1&&child_id[0]=='9'&&child_id[1]=='9') + AOM_ask_value_string(lines[j], "JD2_SFHL", &sffs); + printf("JD2_SFHL:%s\n", sffs); + if(tc_strcmp(sffs,"1")==0) { - a_list->Add(dic); - get_bom(a_list, lines[j], werks, stlan, "", relation_type); - continue; - } - if(rel_cnt) - { - AOM_ask_value_string(rels[0], "jd2_cglx", &val1); - AOM_ask_value_string(rels[0], "jd2_tscg", &val2); - } - if(tc_strcmp(val1,"F")==0&&tc_strcmp(val2,"50")==0) - { - continue; - } - if(tc_strcmp(val1,"E")==0&&tc_strcmp(val2,"50")==0) + AOM_ask_value_string(lines[j], "JD2_sl", &val); + }else { - get_bom(a_list, lines[j], werks, stlan, id, relation_type); - continue; + AOM_ask_value_string(lines[j], "bl_quantity", &val); } - if(tc_strcmp(val1,"F")==0&&tc_strlen(val2)==0) - { - a_list->Add(dic); - continue; + + dic["MENGE"] = convert_to_cstring(val); + + if(is_judge){ + if (rel_cnt) + { + AOM_ask_value_string(rels[0], "jd2_cglx", &val1); + AOM_ask_value_string(rels[0], "jd2_tscg", &val2); + } + if (tc_strcmp(val1, "F") == 0 && tc_strcmp(val2, "50") == 0) + { + continue; + } + if (tc_strcmp(val1, "E") == 0 && tc_strcmp(val2, "50") == 0) + { + get_bom(a_list, lines[j], werks, stlan, 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); - get_bom(a_list, lines[j], werks, stlan,"",relation_type); + get_bom(a_list, lines[j], werks, stlan,"",relation_type, child_is_hl, is_judge); } } int bs_sap_bom(EPM_action_message_t msg) { - printf("start sap bom\n"); + printf("start sap bom1\n"); int ifail = ITK_ok, att_count; tag_t rootTask, *attachments, relation_type, win; char *obj_type; @@ -290,21 +309,26 @@ int bs_sap_bom(EPM_action_message_t msg) int rel_cnt, line_cnt; System::Collections::Generic::List^> ^a_list = gcnew System::Collections::Generic::List^>(); tag_t top_line, *lines, rev, *rels; - char *id, *werks, *stlan; + char *id, *werks, *stlan,*hl; BOM_set_window_top_line_bvr(win, attachments[i], &top_line); AOM_ask_value_tag(top_line, "bl_line_object", &rev); GRM_list_secondary_objects_only(rev, relation_type, &rel_cnt, &rels); AOM_ask_value_string(rev, "item_id", &id); AOM_ask_value_string(rels[0], "jd2_gc", &werks); AOM_ask_value_string(rels[0], "jd2_BOMyt", &stlan); + AOM_UIF_ask_value(rev, "jd2_ishl", &hl); + boolean is_hl = tc_strcmp(hl,"ÊÇ")?false:true; + if (tc_strlen(werks)==0||tc_strlen(stlan)==0) continue; - - get_bom(a_list, top_line, werks, stlan,"", relation_type); + boolean is_judege = id[0] == '9'&&id[1] == '9'; + get_bom(a_list, top_line, werks, stlan,"", relation_type,is_hl,is_judege); string result = ConvertToString(test->send_bom(url, user, password, a_list)); printf("result:%s\n", result.c_str()); if(result.length()&&result[0]=='E') { + BOM_close_window(win); + POM_AM__set_application_bypass(false); EMH_store_error_s1(EMH_severity_error, EMH_ATTR_error_base, result.c_str()); return 1; @@ -313,6 +337,7 @@ int bs_sap_bom(EPM_action_message_t msg) } BOM_close_window(win); POM_AM__set_application_bypass(false); + EMH_clear_errors(); return 0; } diff --git a/HEZON_ITK/bs_sign_cad.cpp b/HEZON_ITK/bs_sign_cad.cpp index 95cb40b..2e9dbb9 100644 --- a/HEZON_ITK/bs_sign_cad.cpp +++ b/HEZON_ITK/bs_sign_cad.cpp @@ -60,7 +60,7 @@ int bs_sign_cad(EPM_action_message_t msg) if(isTypeOf(attachments[i],paras["type"].c_str())) { printf("get item\n"); - AOM_ask_value_tags(attachments[i], "TC_Attaches", &tag_cnt, &tags); + AOM_ask_value_tags(attachments[i], "IMAN_specification", &tag_cnt, &tags); AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &form_cnt, &forms); for(int j=0;j%s\n", ss.str().c_str()); http::Request request(ss.str().c_str()); diff --git a/HEZON_ITK/util.h b/HEZON_ITK/util.h index 31c36ce..f85530c 100644 --- a/HEZON_ITK/util.h +++ b/HEZON_ITK/util.h @@ -51,7 +51,7 @@ #include "tchar.h" #include "ics/ics.h" #include "ics/ics2.h" -#using "C:/Users/lyf/source/repos/Testdll/bin/Debug/declib.dll" +#using "./declib.dll" using namespace std; using namespace Testdll;