diff --git a/HEZON_ITK/bs_sap.cpp b/HEZON_ITK/bs_sap.cpp index 00b6e58..b66e9eb 100644 --- a/HEZON_ITK/bs_sap.cpp +++ b/HEZON_ITK/bs_sap.cpp @@ -166,8 +166,8 @@ 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,boolean is_hl,boolean is_judge,vector &bom_ids) -{ int line_cnt; +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, vector &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::ListCount==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 ^dic = gcnew System::Collections::Generic::Dictionary(); @@ -191,7 +190,7 @@ void get_bom(System::Collections::Generic::List(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::List0 ? 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 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^> ^a_list = gcnew System::Collections::Generic::List^>(); tag_t top_line, *lines, rev, *rels; @@ -343,11 +341,10 @@ int bs_sap_bom(EPM_action_message_t msg) { AOM_ask_value_string(rev, "item_id", &id); 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') { diff --git a/HEZON_ITK/epm_handler_common.h b/HEZON_ITK/epm_handler_common.h index b1aa232..24063c2 100644 --- a/HEZON_ITK/epm_handler_common.h +++ b/HEZON_ITK/epm_handler_common.h @@ -53,7 +53,6 @@ extern "C" { int jd_send_mail(EPM_action_message_t msg); int jd_get_target(EPM_action_message_t msg); int jd_check_wlms_len(EPM_rule_message_t msg); -int jd_check_wlms_len(EPM_rule_message_t msg); ////��������Ϣǩ��汾������ȥ //int qtmc_sign_ir(EPM_action_message_t msg); diff --git a/HEZON_ITK/jd_check_wlms_len.cpp b/HEZON_ITK/jd_check_wlms_len.cpp index f183b30..5aff677 100644 --- a/HEZON_ITK/jd_check_wlms_len.cpp +++ b/HEZON_ITK/jd_check_wlms_len.cpp @@ -1,43 +1,34 @@ #include "util.h" -int jd_check_wlms_len(EPM_rule_message_t msg) -{ +int jd_check_wlms_len(EPM_rule_message_t msg) { POM_AM__set_application_bypass(true); tag_t root_task, *attachments; int att_cnt; EPM_ask_root_task(msg.task, &root_task); //»ñµÃ¸ùÈÎÎñϵÄ×é¼þ - EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt,&attachments); - for (int i = 0; i < att_cnt; i++) - { - if (isTypeOf(attachments[i],"ItemRevision")) - { + EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments); + for (int i = 0; i < att_cnt; i++) { + if (isTypeOf(attachments[i], "ItemRevision")) { int form_att; tag_t *forms; AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &form_att, &forms); - if (form_att==0) - { + if (form_att == 0) { continue; } char *wlms; AOM_ask_value_string(forms[0], "jd2_wlms", &wlms); cout << "jd2_wlms" << wlms << endl; - int length=0; - for (int i = 0; wlms[i]!=0; i++) - { - if (wlms[i]<128&& wlms[i]>0) - { + int length = 0; + for (int i = 0; wlms[i] != 0; i++) { + if (wlms[i] < 128 && wlms[i]>0) { length++; - } - else - { + } else { i += 2; length++; } } cout << "length: " << length << endl; - if (length>40) - { + if (length > 40) { POM_AM__set_application_bypass(false); return EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, "×Ö·û²»Äܳ¬¹ý40!!!"); } @@ -45,31 +36,4 @@ int jd_check_wlms_len(EPM_rule_message_t msg) POM_AM__set_application_bypass(false); return EPM_go; } -}#include "util.h" - -int jd_check_wlms_len(EPM_rule_message_t msg) { - POM_AM__set_application_bypass(true); - tag_t root_task, *attachments; - int att_cnt; - EPM_ask_root_task(msg.task, &root_task); - EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments); - for (int i = 0;i < att_cnt;i++) { - if (isTypeOf(attachments[i], "ItemRevision")) { - int form_cnt; - tag_t *forms; - AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &form_cnt, &forms); - if (form_cnt == 0) { - continue; - } - char *wlms; - AOM_ask_value_string(forms[0], "jd2_wlms", &wlms); - cout << "jd2_wlms====>" << wlms << endl; - if (tc_strlen(wlms) > 40) { - POM_AM__set_application_bypass(false); - return EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, "ÎïÁÏÃèÊöÊôÐÔ³¤¶È¹ý³¤£¬ÕýÈ·³¤¶ÈÓ¦¸ÃСÓÚµÈÓÚ40¸ö×Ö·û£¡"); - } - } - } - POM_AM__set_application_bypass(false); - return EPM_go; } diff --git a/HEZON_ITK/x64/Release/.NETFramework,Version=v4.0.AssemblyAttributes.asm b/HEZON_ITK/x64/Release/.NETFramework,Version=v4.0.AssemblyAttributes.asm index f31a3cf..f924cf7 100644 --- a/HEZON_ITK/x64/Release/.NETFramework,Version=v4.0.AssemblyAttributes.asm +++ b/HEZON_ITK/x64/Release/.NETFramework,Version=v4.0.AssemblyAttributes.asm @@ -1,8 +1,4 @@ ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.24215.1 ; Generated by VC++ for Common Language Runtime -<<<<<<< HEAD .file "C:\Users\5rKB5bPlusD\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp" -======= -.file "C:\Users\89512\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp" ->>>>>>> 9cec5b3be0639e60437e0ba1a3035139d8301c0a diff --git a/HEZON_ITK/x64/Release/HEZON_ITK.tlog/HEZON_ITK.lastbuildstate b/HEZON_ITK/x64/Release/HEZON_ITK.tlog/HEZON_ITK.lastbuildstate index b61b304..7097f65 100644 --- a/HEZON_ITK/x64/Release/HEZON_ITK.tlog/HEZON_ITK.lastbuildstate +++ b/HEZON_ITK/x64/Release/HEZON_ITK.tlog/HEZON_ITK.lastbuildstate @@ -1,2 +1,2 @@ #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=true:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 -Release|x64|C:\Users\89512\Documents\Visual Studio 2015\Projects\itk\| +Release|x64|E:\work\vs_workspace\jditk\|