Merge branch 'master' of http://plmserver.cn:3000/jd/itk into zxk

main
zouxk 5 years ago
commit d0e40460e5

@ -129,7 +129,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>E:\work\boost_1_72_0;E:\work\include12_2;E:\work\include_cpp12_2;C:\Java\jdk1.8.0_231\include\win32;C:\Java\jdk1.8.0_231\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\Users\lyf\Documents\tclib\include;C:\Users\lyf\Documents\tclib\include_cpp;C:\Program Files\Java\jdk1.8.0_212\include\win32;C:\Program Files\Java\jdk1.8.0_212\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CallingConvention>Cdecl</CallingConvention> <CallingConvention>Cdecl</CallingConvention>
</ClCompile> </ClCompile>
<Link> <Link>
@ -137,8 +137,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>E:\work\boost_1_72_0\vc14\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalDependencies>C:\Users\lyf\Documents\tclib\tc12\lib\*.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>E:\work\lib12_2\*.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<OutputFile>$(OutDir)\bs.dll</OutputFile> <OutputFile>$(OutDir)\bs.dll</OutputFile>
<AdditionalOptions>/FORCE %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/FORCE %(AdditionalOptions)</AdditionalOptions>

@ -207,8 +207,9 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
char *val; char *val;
// AOM_UIF_ask_value(lines[j], "bl_sequence_no", &val); // AOM_UIF_ask_value(lines[j], "bl_sequence_no", &val);
// dic["POSNR"] = convert_to_cstring(val); // dic["POSNR"] = convert_to_cstring(val);
AOM_UIF_ask_value(lines[j], "bl_child_id", &val); char *child_id;
dic["IDNRK"] = convert_to_cstring(val); 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); AOM_UIF_ask_value(lines[j], "bl_quantity", &val);
dic["MENGE"] = convert_to_cstring(val); dic["MENGE"] = convert_to_cstring(val);
@ -220,6 +221,12 @@ void get_bom(System::Collections::Generic::List<System::Collections::Generic::Di
int rel_cnt; int rel_cnt;
AOM_ask_value_tag(lines[j], "bl_line_object", &tag); AOM_ask_value_tag(lines[j], "bl_line_object", &tag);
GRM_list_secondary_objects_only(tag, relation_type, &rel_cnt, &rels); 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')
{
a_list->Add(dic);
get_bom(a_list, lines[j], werks, stlan, "", relation_type);
continue;
}
if(rel_cnt) if(rel_cnt)
{ {
AOM_ask_value_string(rels[0], "jd2_cglx", &val1); AOM_ask_value_string(rels[0], "jd2_cglx", &val1);

@ -2,7 +2,7 @@
void judge_tag(tag_t tag,int index,vector<string> &vec,stringstream &name) void judge_tag(tag_t tag,int index,vector<string> &vec,stringstream &name)
{ {
if(index==vec.size()-1) if(index>=vec.size()-1)
{ {
char *val,*type; char *val,*type;
AOM_ask_value_string(tag, "object_type", &type); AOM_ask_value_string(tag, "object_type", &type);
@ -38,20 +38,22 @@ void judge_tag(tag_t tag,int index,vector<string> &vec,stringstream &name)
} }
int bs_test_release_check(EPM_rule_message_t msg) int bs_test_release_check(EPM_action_message_t msg)
{ {
int ifail = EPM_go, att_count, tag_cnt, rel_cnt; int ifail = ITK_ok, att_count, tag_cnt, rel_cnt;
tag_t rootTask, *attachments, win, top, *tags, tag,*rels; tag_t rootTask, *attachments, win, top, *tags, tag,*rels;
char *val; char *val;
printf("begin bs_test_release_check\n");
EPM_ask_root_task(msg.task, &rootTask); EPM_ask_root_task(msg.task, &rootTask);
EPM_ask_attachments(rootTask, EPM_target_attachment, &att_count, &attachments); EPM_ask_attachments(rootTask, EPM_target_attachment, &att_count, &attachments);
TC_argument_list_t * arguments = msg.arguments; TC_argument_list_t * arguments = msg.arguments;
int arg_cnt = TC_number_of_arguments(arguments), status = 0; int arg_cnt = TC_number_of_arguments(arguments), status = 0;
stringstream name; stringstream name;
// map<string, string> paras; // map<string, string> paras;
map<string, vector<string>> judge_map; map<string, vector<string>> judge_map;
POM_AM__set_application_bypass(true);
for (auto i = 0; i<arg_cnt; i++) for (auto i = 0; i<arg_cnt; i++)
{ {
char *temp_key, *temp_val; char *temp_key, *temp_val;
@ -63,7 +65,7 @@ int bs_test_release_check(EPM_rule_message_t msg)
judge_map[temp[0]] = temp; judge_map[temp[0]] = temp;
} }
for (int i = 0; i<att_count; i++) for (int i = 0; i<att_count; i++)
{ {
bool pass = true; bool pass = true;
@ -74,13 +76,18 @@ int bs_test_release_check(EPM_rule_message_t msg)
{ {
judge_tag(attachments[i], 1, judge_map[type], name); judge_tag(attachments[i], 1, judge_map[type], name);
} }
} }
if (name.str().length()) { if (name.str().length()) {
ifail = EPM_nogo; printf("has error\n");
ifail = 1;
name <<"未发布,请先审核发布!"; name <<"未发布,请先审核发布!";
EMH_store_error_s1(EMH_severity_user_error, EMH_PROP_error_base, name.str().c_str()); EMH_store_error_s1(EMH_severity_warning, EMH_PROP_error_base, name.str().c_str());
} }
POM_AM__set_application_bypass(false);
printf("end bs_test_release_check123\n");
return ifail; return ifail;
} }

@ -44,7 +44,7 @@ int bs_wl_check(EPM_rule_message_t msg);
int bs_bom_save_check(METHOD_message_t *msg, va_list args); int bs_bom_save_check(METHOD_message_t *msg, va_list args);
int bs_sign_cad(EPM_action_message_t msg); int bs_sign_cad(EPM_action_message_t msg);
int jd_signoff(EPM_action_message_t msg); int jd_signoff(EPM_action_message_t msg);
int bs_test_release_check(EPM_rule_message_t msg); int bs_test_release_check(EPM_action_message_t msg);
int bs_bypass(void *retValType); int bs_bypass(void *retValType);
int jd_schedule_joint(EPM_action_message_t msg); int jd_schedule_joint(EPM_action_message_t msg);
int jd_batch_process(EPM_action_message_t msg); int jd_batch_process(EPM_action_message_t msg);

@ -117,8 +117,8 @@ extern DLLAPI int CUST_init_module(int *decision, va_list args)
printf("register bs_sign_cad successfully\n"); printf("register bs_sign_cad successfully\n");
} }
ifail = EPM_register_rule_handler("bs_test_release_check", "bs_test_release_check", ifail = EPM_register_action_handler("bs_test_release_check", "bs_test_release_check",
(EPM_rule_handler_t)bs_test_release_check); (EPM_action_handler_t)bs_test_release_check);
if (ifail) if (ifail)
{ {
printf("register bs_test_release_check failed\n"); printf("register bs_test_release_check failed\n");

Loading…
Cancel
Save