main
zouxk 5 years ago
commit 3e8539443c

6
.gitignore vendored

@ -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/

@ -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)

@ -14,6 +14,12 @@ void save_judge(tag_t top, string &check, string &name, vector<string> &type_vec
continue;
if (find(quantity_type_vec.begin(), quantity_type_vec.end(), val) != quantity_type_vec.end())
{
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)
{

@ -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<System::Collections::Generic::Dictionary<String^, String^>^> ^a_list,tag_t line,char *werks,char *stlan,string pid, tag_t relation_type)
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)
{
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<String^, String^> ^dic = gcnew System::Collections::Generic::Dictionary<String^, String^>();
@ -211,22 +218,33 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
AOM_UIF_ask_value(lines[j], "bl_child_id", &child_id);
dic["IDNRK"] = convert_to_cstring(child_id);
AOM_UIF_ask_value(lines[j], "bl_quantity", &val);
dic["MENGE"] = convert_to_cstring(val);
// AOM_UIF_ask_value(lines[j], "bl_quantity", &val);
AOM_UIF_ask_value(lines[j], "bl_uom", &val);
dic["MEINS"] = convert_to_cstring(val);
char *val1, *val2;
dic["STLAL"] = is_hl ? convert_to_cstring("02") : convert_to_cstring("01");
char *val1, *val2,*hl,*sffs;
tag_t tag,*rels;
int rel_cnt;
AOM_ask_value_tag(lines[j], "bl_line_object", &tag);
AOM_UIF_ask_value(tag, "jd2_ishl", &hl);
boolean child_is_hl = tc_strcmp(hl, "ÊÇ") ? false : true;
GRM_list_secondary_objects_only(tag, relation_type, &rel_cnt, &rels);
if(tc_strlen(child_id)>1&&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;
AOM_ask_value_string(lines[j], "JD2_sl", &val);
}else
{
AOM_ask_value_string(lines[j], "bl_quantity", &val);
}
dic["MENGE"] = convert_to_cstring(val);
if(is_judge){
if (rel_cnt)
{
AOM_ask_value_string(rels[0], "jd2_cglx", &val1);
@ -238,7 +256,7 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
}
if (tc_strcmp(val1, "E") == 0 && tc_strcmp(val2, "50") == 0)
{
get_bom(a_list, lines[j], werks, stlan, id, relation_type);
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)
@ -246,15 +264,16 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
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<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;
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;
}

@ -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<tag_cnt;j++)
@ -69,6 +69,9 @@ int bs_sign_cad(EPM_action_message_t msg)
if(ref)
{
IMF_ask_original_file_name2(ref, &name);
string temp = name;
if (temp.find(".dwg") == -1)
continue;
stringstream path;
path << tempdir <<"\\"<< newGUID() << name;
printf("path:%s\n", path.str().c_str());

Binary file not shown.

@ -64,7 +64,7 @@ DWORD WINAPI sendRequest(void *uid) {
stringstream ss;
ss << "http://";
ss << pref_values;
ss << ":8888/api/deleteJob?uid=";
ss << ":8880/api/deleteJob?uid=";
ss << (char *)uid;
printf("request url====>%s\n", ss.str().c_str());
http::Request request(ss.str().c_str());

@ -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;

Loading…
Cancel
Save