commit 13379ada3fcf68fc97d151c3c0f0782cf5df8419 Author: lijh Date: Fri Dec 22 17:34:46 2023 +0800 20231222 commit diff --git a/xy2/common_itk_util.cpp b/xy2/common_itk_util.cpp new file mode 100644 index 0000000..a506c0e --- /dev/null +++ b/xy2/common_itk_util.cpp @@ -0,0 +1,113 @@ +/** +* @file common_itk_util.cpp +* @brief itk warpper utility function +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 18-July-2008 James +*/ + +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) + + +#include +#include +#include +#include +#include +#include +#include "error_handling.h" +#include "common_itk_util.h" + +int FindDatasetReferenceExt( tag_t datasettype, const char *datasettype_ref, char ext[10] ) +{ + if( datasettype_ref == NULL || ext == NULL ) + return -1; + + strcpy( ext, "" ); + + int ref_count = 0, i; + char **ref_templates = NULL, **ref_formats = NULL; + ITKCALL( AE_ask_datasettype_file_refs( datasettype, datasettype_ref, + &ref_count, &ref_templates, &ref_formats ) ); + for( i=0; itm_year+1900, p->tm_mon+1, + p->tm_yday, p->tm_hour, p->tm_min, p->tm_sec, rand() ); + return 0; +} + +logical IsItemRevisionType( char object_type[WSO_name_size_c + 1] ) +{ + logical is_rev = FALSE; + + tag_t cur_type = NULLTAG, parent_type = NULLTAG, temp_type = NULLTAG; + //ITKCALL( IMANTYPE_find_type( object_type, NULL, &cur_type ) ); + ITKCALL(TCTYPE_find_type(object_type, "", &cur_type)); + + parent_type = cur_type; + temp_type = cur_type; + + do + { + if( cur_type != NULLTAG ) + { + char* cur_type_name = NULL; + ITKCALL(TCTYPE_ask_name2( cur_type, &cur_type_name ) ); + //TC8=================== + //if( stricmp( cur_type_name, "ItemRevision" ) == 0 ) + if( strstr( cur_type_name, "Revision" ) != 0 ) + { + is_rev = TRUE; + break; + } + else {} + } + + ITKCALL(TCTYPE_ask_parent_type( cur_type, &temp_type ) ); + if( temp_type != NULLTAG ) + parent_type = temp_type; + cur_type = parent_type; + } while ( temp_type != NULLTAG ); + + return is_rev; +} + diff --git a/xy2/common_itk_util.h b/xy2/common_itk_util.h new file mode 100644 index 0000000..b394f05 --- /dev/null +++ b/xy2/common_itk_util.h @@ -0,0 +1,28 @@ +/** +* @file common_itk_util.h +* @brief itk warpper utility function +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +*/ +#include +#ifndef COMMON_ITK_UTIL +#define COMMON_ITK_UTIL + +#ifdef __cplusplus +extern "C" { +#endif + + +int FindDatasetReferenceExt( tag_t datasettype, const char *datasettype_ref, char ext[10] ); +int CompareDate( date_t date1, date_t date2 ); +int GetRandomTempFile( char tempFile[256] ); +logical IsItemRevisionType( char object_type[WSO_name_size_c + 1] ); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/xy2/epm_auto_signoff_dataset.cpp b/xy2/epm_auto_signoff_dataset.cpp new file mode 100644 index 0000000..1fb7e5f --- /dev/null +++ b/xy2/epm_auto_signoff_dataset.cpp @@ -0,0 +1,1534 @@ +/** +* @addtogroup workflow +* @{ +*/ + +/** +* @file epm_register_handler.cpp +* @brief itk user exits function implemention +* @date 2009/2/13 +* @author James Pang +* @history +* =================================================================================== +* Date Name Description +* 13-Feb-2009 James created +*/ + +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) + +/** +* @headerfile tcua 头文件 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/** +* @headerfile cpp 头文件 +*/ +//#include "stdafx.h" +#include +#include +#pragma comment( lib, "shell32.lib") +#include +#include + +#include +#include +#include +using namespace std; + +#include "register_handler_methods.h" +//#include "register_handler_head.h" +#include "error_handling.h" +#include "string_helper.h" +#include "common_itk_util.h" + + +int Origin_process_msexcel(tag_t dataset, char *dat_file); +int Origin_process_msword(tag_t dataset, char *dat_file); +int Origin_process_ugmaster( tag_t dataset, char *dat_file); +int Origin_process_autocad( tag_t dataset, char *dat_file); +int Origin_process_proe(tag_t dataset, char *dat_file); +//int Origin_create_temp_file(char *file_content, char *file_name); +int Origin_create_temp_file(char *file_content, char *item_id, char *file_name); +int Origin_process_acad(tag_t dataset, char *dat_file); +#define random(x) (rand()%x) +static int create_rand_number(int *randnum) +{ + srand( (unsigned)time( NULL ) ); + //double d; + //d = random(1000)/7*10000000; + //sprintf (yourID, size, "0x80x8", time (0), rand()); + *randnum=random(1000000)+(long)GetTickCount(); + + //*randnum=int(d); + return 0; +} +int Sample2( tag_t cur_task, char *specified_task_node, tag_t *found_task ) +{ + tag_t job, root_task, root_template; + EPM_ask_job( cur_task, &job ); + EPM_ask_root_task( job, &root_task ); + + + + int sub_task_num = 0; + tag_t *sub_tasks = NULL, the_task = NULLTAG; + EPM_ask_sub_tasks( root_task, &sub_task_num, &sub_tasks ); + for ( int i=0; i0 ); + + if ( !is_valid_node ) + *found_task = NULLTAG; + + return ITK_ok; +} + +int ORIGIN_EPM_check_and_signoff( EPM_action_message_t msg ) +{ + tag_t specified_task = NULLTAG; + printf( "in ORIGIN_EPM_check_and_signoff\n" ); + + char *cur_task_name = NULL; + ITKCALL( EPM_ask_name2( msg.task, &cur_task_name ) ); + + if ( stricmp( cur_task_name, "perform-signoffs" ) == 0 ) + { + ITKCALL( EPM_ask_parent_task( msg.task, &specified_task ) ); + } + else + specified_task = msg.task; + + char* task_type = NULL; + ITKCALL( WSOM_ask_object_type2( specified_task, &task_type ) ); + if ( stricmp( task_type, "EPMReviewTask" ) != 0 ) + { + return ITK_ok; + } + + //取意见或者做别的事情 + + return ITK_ok; +} + +static int CheckTaskValid(EPM_action_message_t msg, logical *is_demote ) +{ + tag_t cur_task = NULLTAG; + char* task_type = NULL; + ITKCALL( WSOM_ask_object_type2( msg.task, &task_type ) ); + if ( stricmp( task_type, "EPMPerformSignoffTask" ) != 0 ) + { + printf(("current task type is not EPMPerformSignoffTask\n" )); + return HANDLER_PLACED_INVALID; + } + +} + + +int ORIGIN_ask_task_node(tag_t cur_task, char *task_node_name, tag_t *task_node) +{ + tag_t job, root_task; + char buf[BUFSIZ] = ""; + + ITKCALL(EPM_ask_job(cur_task, &job)); + ITKCALL(EPM_ask_root_task(job, &root_task)); + + int sub_task_num = 0; + tag_t *sub_tasks = NULL, the_task = NULLTAG; + ITKCALL(EPM_ask_sub_tasks(root_task, &sub_task_num, &sub_tasks)); + for (int i = 0; i < sub_task_num; i++) + { + char* task_name = NULL; + ITKCALL(EPM_ask_name2(sub_tasks[i], &task_name)); + if (stricmp(task_name, task_node_name) == 0) + { + the_task = sub_tasks[i]; + break; + } + } + MEM_free( sub_tasks ); + + if (the_task == NULLTAG) + { + sprintf( buf, "no specified task\n" ); + printf( (buf) ); + return WORKFLOW_NODE_IS_NOT_VALID; + } + + char* cur_task_name = NULL; + ITKCALL(EPM_ask_name2(cur_task, &cur_task_name)); printf( "cur task = %s\n", cur_task_name ); + + logical is_valid_node = FALSE; + int num_success = 0; + tag_t *successors = NULL; + ITKCALL(AOM_ask_value_tags(the_task, "successors", &num_success, &successors)); + + if(num_success != 0) + { + do + { + tag_t one_successor = successors[0]; + MEM_free(successors); + + char* successor_name = NULL; + ITKCALL(EPM_ask_name2(one_successor, &successor_name)); + if (strcmp(successor_name, cur_task_name) == 0) + { + is_valid_node = TRUE; + *task_node = the_task; + break; + } + + ITKCALL(AOM_ask_value_tags(one_successor, "successors", &num_success, &successors)); + } while (num_success > 0); + } + + if (!is_valid_node) + { + *task_node = NULLTAG; + } + + return ITK_ok; +} + +int ORIGIN_ask_sign_info(tag_t task_node, char *output_str,char *task_name) +{ + //strcpy(output_str, ""); + tag_t cur_perform_task = NULLTAG, tempTask = NULLTAG; + char* cur_task_name = NULL, buf[BUFSIZ] = ""; + + ITKCALL( EPM_ask_name2( task_node, &cur_task_name ) ); + printf("cur_task_name = %s\n",cur_task_name); + + if ( stricmp( cur_task_name, "perform-signoffs" ) == 0 ) + { + cur_perform_task = task_node; + ITKCALL( EPM_ask_parent_task( cur_perform_task, &tempTask ) ); + ITKCALL( EPM_ask_name2( tempTask, &cur_task_name ) ); + } + else if( strcmp( cur_task_name, "编制" ) == 0 ) + { + cur_perform_task = task_node; + } + else + { + ITKCALL( EPM_ask_sub_task(task_node, "perform-signoffs", &cur_perform_task) ); + if ( cur_perform_task != NULLTAG ) + { + ITKCALL( EPM_ask_name2( task_node, &cur_task_name ) ); + } + } + //cur_perform_task = task_node; + //printf("output_str=%s\n",output_str); + if(cur_perform_task != NULLTAG ) + { + //printf("output_str=%s\n",output_str); + //if( strcmp( cur_task_name, "编制" ) == 0 ) + //{ + // printf("编制!================\n"); + // //printf("output_str=%s\n",output_str); + // + // printf("task_name=%s\n",task_name); + // int s; + // EPM_decision_t decision = EPM_nogo; + // char* userName; + // tag_t aUserTag, responsibleParty; + + // s = EPM_ask_responsible_party(cur_perform_task, &responsibleParty); + // if (responsibleParty!= NULLTAG) + // { + // decision = EPM_go; + // } + // + // s = POM_get_user (&userName, &aUserTag); + // date_t decision_date; + // char person_name[SA_name_size_c + 1] = ""; + + // //if( strstr(output_str,"编制")==NULL ) + // { + // ITKCALL(SA_ask_user_person_name(aUserTag, person_name)); + // strcat(output_str, "|"); + // strcat(output_str, cur_task_name); + // strcat(output_str, "="); + // strcat(output_str, person_name); + // strcat(output_str, "|"); + // strcat(output_str, cur_task_name); + // strcat(output_str, "日期="); + // char* prop_name="last_mod_date";//或date_released + // + // ITKCALL(AOM_ask_value_date(cur_perform_task,prop_name,&decision_date)); + // char date_buf[20] = ""; + // sprintf( date_buf, "%4d-%02d-%02d", decision_date.year, decision_date.month+1, decision_date.day ); + // strcat( output_str, date_buf ); + // printf(output_str); + // printf("\n"); + // } + // + // MEM_free (userName); + // + //} + //else + { + int perform_count = 0; + int *attach_type; + tag_t *perform_attaches = NULL; + + //ITKCALL(EPM_ask_attachments(cur_perform_task, EPM_signoff_attachment, &perform_count, &perform_attaches)); + ITKCALL(EPM_ask_all_attachments(cur_perform_task,&perform_count,&perform_attaches,&attach_type)); + sprintf( buf, "EPM_signoff_attachment Counts = %d\n", perform_count); + if(perform_count ==0) + { + //ITKCALL(EPM_ask_attachments(cur_perform_task, EPM_target_attachment, &perform_count, &perform_attaches)); + + sprintf( buf, "perform_count = %d\n", perform_count); + printf(buf); + //printf( (buf) ); + } + for(int i = 0; i < perform_count; i++) + { + //printf("attach_type = %d\n", attach_type[i]); + tag_t memberTag = NULLTAG; + SIGNOFF_TYPE_t memberType; + //CR_signoff_decision_t signoff_decision; + EPM_signoff_decision_t signoff_decision; + char* comments = NULL; + date_t decision_date; + char* person_name = NULL; + + ITKCALL(EPM_ask_signoff_member(perform_attaches[i], &memberTag, &memberType)); + //ITKCALL(CR_ask_signoff_decision(perform_attaches[i], &signoff_decision, comments, &decision_date)); + ITKCALL(EPM_ask_signoff_decision(perform_attaches[i], &signoff_decision, &comments, &decision_date)); + if(memberType == SIGNOFF_GROUPMEMBER )//&& strstr(cur_task_name,"编制")==NULL) + { + printf("\ncur_task_name = %s\n",cur_task_name); + tag_t user_tag = NULLTAG, group_tag = NULLTAG, role_tag = NULLTAG; + + ITKCALL(SA_ask_groupmember_user(memberTag, &user_tag)); + ITKCALL(SA_ask_user_person_name2(user_tag, &person_name)); + + strcat(output_str, "|"); + strcat(output_str, cur_task_name); + strcat(output_str, "="); + strcat(output_str, person_name); + strcat(output_str, "|"); + strcat(output_str, cur_task_name); + strcat(output_str, "日期="); + + char date_buf[20] = ""; + sprintf( date_buf, "%4d-%02d-%02d", decision_date.year, decision_date.month+1, decision_date.day ); + strcat( output_str, date_buf ); + } + } + } + } + + return ITK_ok; +} + + +int ORIGIN_EPM_auto_signoff(EPM_action_message_t msg) +{ + char *arg = 0; + char *name = NULL, *value = NULL, buf[BUFSIZ] = ""; + logical hasDemoteNode = FALSE; + char* task_name = NULL; + char sign_info[1024] = ""; + char* root_task_name = NULL; + tag_t current_task = msg.task; + + int sub_task_count = 0; + tag_t root_task = NULLTAG, *sub_tasks = NULL; + ITKCALL( EPM_ask_root_task( msg.task, &root_task ) ); + ITKCALL( EPM_ask_sub_tasks( root_task, &sub_task_count, &sub_tasks) ); + ITKCALL( EPM_ask_name2( root_task, &root_task_name ) ); + printf("root_task_name=%s\n",root_task_name); + ITKCALL( EPM_ask_name2( current_task, &task_name ) ); + printf( "sub_task_count = %d\n", sub_task_count ); + + if(strcmp(task_name,"编制")==0) + { + printf("task_name=%s\n",task_name); + int s; + EPM_decision_t decision = EPM_nogo; + + tag_t aUserTag, responsibleParty; + + s = EPM_ask_responsible_party(current_task, &responsibleParty); + if (responsibleParty!= NULLTAG) + { + decision = EPM_go; + } + char* userName; + s = POM_get_user (&userName, &aUserTag); + date_t decision_date; + char* person_name = NULL; + ITKCALL(SA_ask_user_person_name2(aUserTag, &person_name)); + strcat(sign_info, "|"); + strcat(sign_info, task_name); + strcat(sign_info, "="); + strcat(sign_info, person_name); + strcat(sign_info, "|"); + strcat(sign_info, task_name); + strcat(sign_info, "日期="); + char* prop_name="last_mod_date";//或date_released + + ITKCALL(AOM_ask_value_date(current_task,prop_name,&decision_date)); + char date_buf[20] = ""; + sprintf( date_buf, "%4d-%02d-%02d", decision_date.year, decision_date.month+1, decision_date.day ); + strcat( sign_info, date_buf ); + printf(sign_info); + printf("\n"); + MEM_free (userName); + + } + else + { + for ( int i=0; itm_year,p->tm_mon+1 ,p->tm_mday+1 ,p->tm_hour,p->tm_min ,p->tm_sec); +// } +// else +// { +// sprintf_s(local_path, "%s\\%d-%d-%d-%d-%d-%d.dat", temp_dir, +// 1900+p->tm_year,p->tm_mon+1 ,p->tm_mday+1 ,p->tm_hour,p->tm_min ,p->tm_sec); +// } +// +// if((filePtr = fopen(local_path, "wt")) == NULL) +// { +// printf("Can not create the temp dat file!\n"); +// return -1; +// } +// +// strcpy(file_name, local_path); +// +// fwrite(file_content, sizeof(char), strlen(file_content), filePtr); +// fclose(filePtr); +// +// return ITK_ok; +//} +int Origin_create_temp_file(char *file_content,char *item_id, char *file_name) +{ + time_t now; + struct tm *p; + FILE *filePtr = NULL; + + char *temp_dir = getenv("TEMP"); + char local_path[MAX_PATH] = ""; + + time(&now); + p = localtime(&now); + if(temp_dir[strlen(temp_dir) - 1] == '\\') + { + sprintf_s(local_path, "%s%s%d-%d-%d-%d-%d-%d.dat", temp_dir,item_id, + 1900+p->tm_year,p->tm_mon+1 ,p->tm_mday+1 ,p->tm_hour,p->tm_min ,p->tm_sec); + } + else + { + sprintf_s(local_path, "%s\\%s%d-%d-%d-%d-%d-%d.dat", temp_dir,item_id, + 1900+p->tm_year,p->tm_mon+1 ,p->tm_mday+1 ,p->tm_hour,p->tm_min ,p->tm_sec); + } + + if((filePtr = fopen(local_path, "wt")) == NULL) + { + printf("Can not create the temp dat file!\n"); + return -1; + } + + strcpy(file_name, local_path); + + fwrite(file_content, sizeof(char), strlen(file_content), filePtr); + fclose(filePtr); + + return ITK_ok; +} + + +void TC2C(const PTCHAR tc, char * c) +{ + #if defined(UNICODE) + WideCharToMultiByte(CP_ACP, 0, tc, -1, c, wcslen(tc), 0, 0); + c[wcslen(tc)] = 0; + #else + lstrcpy((PTSTR)c, (PTSTR)tc); + #endif +} +int ORIGIN_EPM_signoff_itemid(EPM_action_message_t msg) +{ + char *arg = 0; + char *name = NULL, *value = NULL, buf[BUFSIZ] = ""; + logical hasDemoteNode = FALSE; + char* task_name = NULL; + char sign_info[1024] = ""; + char* root_task_name = NULL; + + tag_t current_task = msg.task; +//============================================================ + map item_types_map; + map::iterator item_types_map_iter = item_types_map.begin(); + logical is_debug = FALSE; + char value_name[128]=""; + char fixed_prop[WSO_name_size_c + 1]=""; + char *flag = NULL; + int sub_task_count = 0; + + POM_AM__set_application_bypass(TRUE); + int num_of_arguments = TC_number_of_arguments( msg.arguments ); + + for (int i=0; i ans; + Split( value, ',', ans ); + for (size_t j=0; j +#include + +#include +#include + +#define ECHO(X) printf X; +#define SYS_LOG(X) IMAN_write_syslog X; +#define LOG_ECHO(X) printf X; IMAN_write_syslog X; + +/*! +* \def CALL(x) +* 打印错误信息 +*/ +#define CALL(x) { \ + int stat; \ + char *err_string; \ + if( (stat = (x)) != ITK_ok) \ + { \ + EMH_ask_error_text (stat, &err_string); \ + LOG_ECHO( ("ERROR: %d ERROR MSG: %s.\n",stat, err_string) ) \ + LOG_ECHO( ("Function: %s FILE: %s LINE: %d\n", #x, __FILE__, __LINE__ ) ) \ + MEM_free (err_string); \ + return (stat); \ + } \ +} + +/*! +* \def DO(x) +* 打印错误信息 +*/ +#define DO(x) { \ + int stat; \ + char *err_string; \ + if( (stat = (x)) != POM_ok) \ + { \ + EMH_ask_error_text (stat, &err_string); \ + printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \ + printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \ + MEM_free (err_string); \ + } \ +} + +/*! +* \def CALLRNULL(x) +* 打印错误信息 +*/ +#define CALLRNULL(x) { \ + int stat; \ + char *err_string; \ + if( (stat = (x)) != ITK_ok) \ + { \ + EMH_ask_error_text (stat, &err_string); \ + printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \ + printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \ + MEM_free (err_string); \ + return ((char *)NULL); \ + } \ +} + +/*! +* \def CALL2(x) +* 打印错误信息 +*/ +#define CALL2(x) { \ + int stat, n_ifails, *serverities, *ifails, err_count; \ + char *err_string, **texts; \ + if( (stat = (x)) != ITK_ok) \ + { \ + printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \ + EMH_ask_errors( &n_ifails, (const int**)(&serverities), (const int**)(&ifails), (const char***)(&texts) );\ + for( err_count=0; err_count +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include
+ +#include +#include +/** +* @headerfile standard c & cpp header files +*/ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +//#include +using namespace std; + +/** +* @headerfile user's header files +*/ +#include "register_handler_methods.h" +#include "error_handling.h" +#include "string_helper.h" +#include "itk_service_common.h" + +//static int CycleLovFilter( tag_t lov_tag, const char *prop_value, int lov_order, int filter_level, string &prop_desc ) +//{ +// int ifail = ITK_ok; +//printf("CycleLovFilter\n"); +// if (lov_tag == NULLTAG) +// return ITK_ok; +// else if ( prop_desc.size()==0 ) +// { +//printf("filter_level=%d,lov_order=%d\n",filter_level,lov_order); +// if (filter_level == lov_order) +// { +// int n_values = 0, lov_index = 0; +// char **lov_values = NULL; +// int *lov_int=0; +// logical find_prop_value = FALSE; +// +// ITKCALL( LOV_ask_values_string( lov_tag, &n_values, &lov_values ) ); +// +// for (int li=0; li0) +// { +// for (int li=0; li0) +// { +// for (int li=0; li0) +// prop_value.assign(prop_desc); +// } +// //if (lov_tag) //如果没有与属性关联的lov,则不处理 +// //{ +// // int lov_order = 0; +// +// // char object_type[WSO_name_size_c + 1] = ""; +// // ITKCALL( WSOM_ask_object_type2( object, object_type ) ); +// // ITKCALL( LOV_ask_attached_dependency_order( object_type, prop_name, &lov_order ) ); +// // string prop_desc; +// // if(lov_order==0) +// // { +// // int n_values = 0, lov_index = 0; +// // char **lov_values = NULL; +// // logical find_prop_value = FALSE; +// // LOV_usage_t usage; +// // char **desc_strings = NULL; +// // logical *is_null = NULL; +// // logical *is_empty = NULL; +// // printf("开始取描述值\n"); +// // ITKCALL( LOV_ask_value_descriptions( lov_tag, &usage, +// // &n_values, &desc_strings, &is_null, &is_empty ) ); +// // if (is_null[lov_index]==FALSE && is_empty[lov_index]==FALSE) +// // { +// // printf("desc_strings[lov_index]=%s\n",desc_strings[lov_index]); +// // prop_desc.assign(desc_strings[lov_index]); +// // } +// // MEM_free(desc_strings); +// // MEM_free(is_null); +// // MEM_free(is_empty); +// // } +// // else +// // { +// // //string prop_desc; +// // CycleLovFilter(lov_tag, str_value, lov_order, 1, prop_desc ); +// +// // } +// // if (prop_desc.size()>0) +// // prop_value.assign(prop_desc); +// //} +// +// if (prop_value.size()==0) +// { +// prop_value.assign(str_value); +// } +// +// MEM_free(str_value); +// return ITK_ok; +// } +// } +// } +// else if (prop_type == PROP_int) +// { +// int int_value = NULL; +// ITKCALL( AOM_ask_value_int( object, prop_name, &int_value ) ); +// char buf[100] = ""; +// sprintf( buf, "%d", int_value ); +// prop_value.assign(buf); +// } +// } +// +// return ITK_ok; +//} + +int IncludeChinese(char *str)//返回0:无中文,返回1:有中文 +{ + char c; + int n=0; + while(1) + { + c=*str++; + if (c==0) break; //如果到字符串尾则说明该字符串没有中文字符 + if (c&0x80) //如果字符高位为1且下一字符高位也是1则有中文字符 + { + if (*str & 0x80) + { + n++; + }; + + } + } + return n; +} + +static int CycleLovFilter(map &lov_rel_props_value, const char *prop_name, + tag_t lov_tag, int lov_order, int filter_level, const char *prop_value, string &prop_desc) +{ + int ifail = ITK_ok; + + if (lov_tag == NULLTAG) + return ITK_ok; + printf("prop_name = %s, prop_vlaue = %s, prop_desc = %s\n", prop_name, prop_value, prop_desc.c_str()); + printf("prop_desc.size() = %d, filter_level = %d, lov_order = %d\n", prop_desc.size(), filter_level, lov_order); + + if (prop_desc.size() == 0) + { + if (filter_level == lov_order) + { + int n_values = 0, lov_index = 0; + char **lov_values = NULL; + logical find_prop_value = FALSE; + + ITKCALL( LOV_ask_values_string( lov_tag, &n_values, &lov_values ) ); + for (int li=0; li::iterator current_order_value = lov_rel_props_value.find(filter_level); + + //找到跟filter_level对应的属性值的索引 + if (current_order_value != lov_rel_props_value.end()) + { + logical find_secondary_level_index = 0; + + int n_values = 0; + char **lov_values = NULL; + logical find_prop_value = FALSE; + + ITKCALL( LOV_ask_values_string( lov_tag, &n_values, &lov_values ) ); + for (int li=0; lisecond.c_str()) == 0) + { + current_level_value_index = li; + break; + } + } + MEM_free(lov_values); + + //找到根filter_level索引值对应的子lov对象 + int n_listOfFilters = 0, *listOfFiltersIndexes = NULL; + tag_t *listOfFilters = NULL; + ITKCALL( LOV_ask_value_filters( lov_tag, &n_listOfFilters, &listOfFiltersIndexes, &listOfFilters ) ); + map filtersMap; + map::iterator filtersMapIter; + for (int li=0; lisecond, lov_order, filter_level+1, prop_value, prop_desc); + } + } + } + } + + return ifail; +} + +static int FindPropLovDesc( tag_t object, const char *prop_name, PROP_value_type_t prop_type, string &prop_value ) +{ + int ifail = ITK_ok; + char buf[BUFSIZ] = ""; + + if (object==NULLTAG) + return POM_inst_not_loaded; + + prop_value.clear(); + + //数组属性统一处理 + int max_prop_elems = 0; + ITKCALL( AOM_ask_max_num_elements( object, prop_name, &max_prop_elems ) ); + if( max_prop_elems != 1 ) + { + char *d_vlaue = NULL; + ITKCALL( AOM_UIF_ask_value( object, prop_name, &d_vlaue ) ); + if (d_vlaue && *d_vlaue) + { + prop_value.assign(d_vlaue); + MEM_free(d_vlaue); + return ITK_ok; + } + } + else + { + if (prop_type == PROP_string) + { + tag_t prop_descriptor = NULLTAG; + ITKCALL( AOM_ask_descriptor( object, prop_name, &prop_descriptor ) ); + + logical is_lov_des_attached = FALSE; + ITKCALL( PROPDESC_is_lov_desc_attach( prop_descriptor, &is_lov_des_attached ) ); + if (is_lov_des_attached) //如果当前属性已经是lov的描述,则不再处理,仅赋值给返回对象 + { + char *str_value = NULL; + ITKCALL( AOM_ask_value_string( object, prop_name, &str_value ) ); + if (str_value && *str_value) + { + prop_value.assign(str_value); + MEM_free(str_value); + } + } + else + { + char *str_value = NULL; + ITKCALL( AOM_ask_value_string( object, prop_name, &str_value ) ); + + if (str_value && *str_value) //仅在属性有值的情况下取其lov描述 + { + tag_t lov_tag = NULLTAG; + ITKCALL( AOM_ask_lov( object, prop_name, &lov_tag ) ); + + if (lov_tag) //如果没有与属性关联的lov,则不处理 + { + map lov_rel_props; + + char* object_type = NULL; + ITKCALL( WSOM_ask_object_type2( object, &object_type ) ); + + //得到Form的存储类 + //tag_t class_id = NULLTAG; + //ITKCALL( POM_class_of_instance( object, &class_id ) ); + //char *class_name = NULL; + //ITKCALL( POM_name_of_class( class_id, &class_name ) ); + //if (strcmp(class_name, "Form") == 0) + //{ + // tag_t type_tag = NULLTAG; + // ITKCALL( TCTYPE_find_type( object_type, NULL, &type_tag ) ); + + // char *def_class_name = NULL; + // ITKCALL( FORMTYPE_ask_def_class_name( type_tag, &def_class_name ) ); + // strcpy( object_type, def_class_name ); + // MEM_free(def_class_name); + //} + //MEM_free(class_name); + + //得到跟当前Form及LOV关联的所有属性 + int n_attach = 0, *orders = NULL, *n_parents = NULL; + char **type_names = NULL, **prop_names = NULL; + logical *descAttaches = NULL; + ITKCALL( LOV_ask_attached_properties_info( lov_tag, &n_attach, &type_names, &prop_names, &orders, &n_parents, &descAttaches ) ); + for (int ai=0; ai lov_rel_props_value; + for (map::iterator iter = lov_rel_props.begin(); iter != lov_rel_props.end(); iter++) + { + char *prop_value = NULL; + ITKCALL( AOM_ask_value_string(object, iter->second.c_str(), &prop_value) ); + lov_rel_props_value.insert(make_pair(iter->first, prop_value)); + MEM_free(prop_value); + } + + int lov_order = 0; + ITKCALL( LOV_ask_attached_dependency_order( object_type, prop_name, &lov_order ) ); +printf("lov_order = %d\n", lov_order); + string prop_desc; + CycleLovFilter( lov_rel_props_value, prop_name, lov_tag, lov_order, 1, str_value, prop_desc); + if (prop_desc.size()>0) + prop_value.assign(prop_desc); + } + + if (prop_value.size()==0) + { + prop_value.assign(str_value); + } + + MEM_free(str_value); + return ITK_ok; + } + } + } + else if (prop_type == PROP_int) + { + int int_value = NULL; + ITKCALL( AOM_ask_value_int( object, prop_name, &int_value ) ); + char buf[100] = ""; + sprintf( buf, "%d", int_value ); + prop_value.assign(buf); + } + } + + return ITK_ok; +} + + +int jy_create_material_code(EPM_action_message_t msg) +{ + int ifail = ITK_ok; + logical is_debug = FALSE; + char fixed_prop[WSO_name_size_c + 1]=""; + char buf[BUFSIZ] = "", *flag = NULL, *value = NULL; + + //item master form relation type + tag_t master_form_rel_type = NULLTAG; + ITKCALL( GRM_find_relation_type( TC_master_form_rtype, &master_form_rel_type ) ); + + //parse some arguments + map item_types_map; + map::iterator item_types_map_iter = item_types_map.begin(); + vector required_props_vec; + int sid_leng = 0, max_sid = 0, pre_len = 0; + + char target_prop[WSO_name_size_c + 1] = ""; + int num_of_arguments = TC_number_of_arguments( msg.arguments ); + for (int i=0; i ans; + Split( value, ',', ans ); + for (size_t j=0; j ans; + Split( value, ',', ans ); printf( "ans size = %d\n", ans.size() ); + for (size_t j=0; jfirst.c_str(), NULL, &item_type ) ); + ITKCALL( TCTYPE_ask_class_name2( item_type, &item_type_class ) ); + printf("\nitem_type_class=%s\n",item_type_class); + ITKCALL( TCTYPE_ask_parent_type( item_type,&parent_type_tag) ); + ITKCALL( TCTYPE_ask_class_name2( parent_type_tag, &parent_type_class ) ); + //TC8============================== + //if (strcmp( parent_type_class, "Item" ) != 0) + //if (strcmp( item_type_class, "Item" ) != 0) + if (strstr(item_type_class,"XY")==NULL) + { + //sprintf( buf, "type %s not Item or its sub type%s\n", item_types_map_iter->first.c_str() ); + sprintf( buf, "%s is not XY Item or its sub type%s\n", item_types_map_iter->first.c_str() ); + printf( (buf) ); + break; + } + + char *rev_master_type_name = NULL; + ITKCALL( ITEM_ask_rev_master_form_type( item_types_map_iter->first.c_str(), &rev_master_type_name ) ); + + tag_t rev_master_type = NULLTAG; + ITKCALL( TCTYPE_find_type( rev_master_type_name, NULL, &rev_master_type ) ); + + for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + { + char one_prop[WSO_name_size_c + 1] = ""; + strcpy( one_prop, required_props_vec[ri].c_str() ); + + tag_t pd_tag = NULLTAG; + ifail = TCTYPE_ask_property_by_name( rev_master_type, one_prop, &pd_tag ); + if (ifail != ITK_ok || pd_tag == NULLTAG) + { + sprintf( buf, "property %s not found from type %s\n", one_prop, rev_master_type_name ); + printf( (buf) ); + + prop_not_defined = TRUE; + break; + } + } + + if (!prop_not_defined) + { + tag_t pd_tag = NULLTAG; + ifail = TCTYPE_ask_property_by_name( rev_master_type, target_prop, &pd_tag ); + if (ifail != ITK_ok || pd_tag == NULLTAG) + { + sprintf( buf, "property %s not found from type %s\n", target_prop, rev_master_type_name ); + printf( (buf) ); + + prop_not_defined = TRUE; + break; + } + } + + if (prop_not_defined) + { + break; + } + } + + if (prop_not_defined) + { + return PROP_no_properties; + } + + if ( is_debug ) //print arguments specified for handler + { + item_types_map_iter = item_types_map.begin(); + for (; item_types_map_iter!=item_types_map.end(); item_types_map_iter++) + { + sprintf( buf, "Type: %s, ", item_types_map_iter->first.c_str() ); + printf( (buf) ); + } + sprintf( buf, "\n" ); + printf( (buf) ); + + for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + { + sprintf( buf, "Prop: %s, ", required_props_vec[ri].c_str() ); + printf( (buf) ); + } + sprintf( buf, "Prop: %s\n", target_prop ); + printf( (buf) ); + + sprintf( buf, "Max Flow ID Leng: %d\n", max_sid ); + printf( (buf) ); + } + +//STEP 2: + //retrieve item revisions related in reference's list + tag_t job = NULLTAG, root_task = NULLTAG; + ITKCALL( EPM_ask_job( msg.task, &job ) ); + ITKCALL( EPM_ask_root_task( job, &root_task ) ); + + //current task's reference list + int reference_count = 0; + tag_t *reference_list = NULL; + ITKCALL( EPM_ask_attachments( root_task, EPM_target_attachment, &reference_count, &reference_list ) ); + vector reference_revs_vec; + for (int ri=0; ri prop_type_map; + map::iterator prop_type_map_iter; + //得到指定属性的值类型 + printf( "222222222\n" ); + for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + { + printf( "required_props_vec[ri]=%s\n",required_props_vec[ri].c_str() ); + PROP_value_type_t valtype; + char *valtype_n = NULL; + ITKCALL( AOM_ask_value_type( master_form, required_props_vec[ri].c_str(), &valtype, &valtype_n ) ); + //if (is_debug) + { + sprintf( buf, "prop type = %s\n", valtype_n ); + } + MEM_free(valtype_n); + prop_type_map.insert( make_pair(required_props_vec[ri], valtype) ); + } + printf( "3333333333\n" ); + //得到指定的属性 + string material_code_mark(""); + for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + { + prop_type_map_iter = prop_type_map.find(required_props_vec[ri]); + printf( "prop_type_map_iter\n" ); + PROP_value_type_t valtype = prop_type_map_iter->second; + + string prop_value; + ITKCALL(RES_checkout2(master_form,"","","",RES_EXCLUSIVE_RESERVE)); + ITKCALL(RES_cancel_checkout (master_form,false)); + printf( "=============FindPropLovDesc\n" ); + FindPropLovDesc( master_form, required_props_vec[ri].c_str(), valtype, prop_value ); + printf( "FindPropLovDesc=============\n" ); + if (prop_value.size()>0) + { + material_code_mark.append(prop_value); + } + } + printf( "material_code_mark=%s\n",material_code_mark.c_str() ); + if(material_code_mark.empty()) + { + printf( ("编码未指定, please check!\n") ); + return EPM_task_not_complete; + } + char *newID = NULL; + ITKCALL( SERVICE_internal_part_no( material_code_mark.c_str(), sid_leng, 1, max_sid, 1, &newID ) ); + if (newID && *newID && strlen(newID)>0) + { + printf("newID=%s\n",newID); + //sprintf(newID,"%s测试","lala"); + if(IncludeChinese(newID)>0) + { + printf("物料编码:%s,含有中文,请联系系统管理员解决此问题!\n",newID); + return EPM_task_not_complete; + } + + material_code_mark.assign(newID); + MEM_free(newID); + } + + if (is_debug) + { + sprintf( buf, "new material code is %s\n", material_code_mark.c_str() ); + printf( (buf) ); + } + + //检查写权限 + logical can_change_form = FALSE; + ITKCALL( AM_check_privilege(master_form, "WRITE", &can_change_form ) ); + PROP_protection_t protection; + tag_t prop_tag=NULLTAG; + ITKCALL(TCTYPE_ask_property_by_name(master_form, target_prop, &prop_tag)); + + //=========================权限放开 + if (can_change_form) + { + //TC8============== + ITKCALL(AOM_load (master_form) ); + ITKCALL(RES_checkout2(master_form,"","","",RES_EXCLUSIVE_RESERVE)); + ITKCALL(RES_cancel_checkout (master_form,false)); + //ITKCALL( AOM_unlock( master_form ) ); + //ITKCALL( AOM_lock( master_form ) ); + //logical on_or_off=true; + printf("material_code_mark = %s\n",material_code_mark.c_str()); + printf("target_prop = %s\n",target_prop); + //ITKCALL( PROPDESC_set_protection (prop_tag,PROP_write) ); + //char *prop_value=NULL; + //ITKCALL( AOM_ask_value_string(master_form,target_prop,&prop_value)); + //printf("prop_value=%s\n",prop_value); + ITKCALL( AOM_set_value_string( master_form, target_prop, material_code_mark.c_str() ) ); + ITKCALL( AOM_save( master_form ) ); + ITKCALL( AOM_unlock( master_form ) ); + //fixed_prop + char temp_code[64]=""; + strncpy(temp_code,material_code_mark.c_str(),pre_len); + strcat(temp_code,"\0"); + //TC8============== + ITKCALL(AOM_load (master_form) ); + //ITKCALL( AOM_unlock( master_form ) ); + //ITKCALL( AOM_lock( master_form ) ); + //ITKCALL( PROPDESC_set_protection (prop_tag,PROP_write)); + ITKCALL( AOM_set_value_string( master_form, fixed_prop, temp_code ) ); + ITKCALL( AOM_save( master_form ) ); + ITKCALL( AOM_unlock( master_form ) ); + } + else + { + printf( ("reviewer has no write privilege to add attachment\n" ) ); + return AM_insufficient_access; + } + } + + return ITK_ok; +} + diff --git a/xy2/main_lib.cpp b/xy2/main_lib.cpp new file mode 100644 index 0000000..7c2e39a --- /dev/null +++ b/xy2/main_lib.cpp @@ -0,0 +1,43 @@ +/** +* @headerfile tcua 头文件 +*/ +#include +#include "register_handler_methods.h" +#ifdef __cplusplus +extern "C" { +#endif + + + /** + * @fn extern "C" DLLAPI int liborigin_register_CALLbacks + * @return usually return ITK_ok + * @brief liborigin customization entry + * 此函数必须有规范的写法,必须以dll的名称加上"_"开头 + */ + //extern DLLAPI int xy2_register_CALLbacks() + int xy2_register_CALLbacks() + { + int ifail = ITK_ok; + TC_write_syslog("*******************************************************************************\n"); + TC_write_syslog("* xy2 register_CALLbacks is starting *\n"); + TC_write_syslog("*******************************************************************************\n"); + + fprintf(stdout, "\n xy2 注册成功\n"); + + + ITKCALL(ifail = CUSTOM_register_exit("xy2", "USERSERVICE_register_methods", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_methods)); + fprintf(stdout, "\n xy2 registering USERSERVICE_custom_register_methods completed!\n"); + + + ITKCALL(ifail = CUSTOM_register_exit("xy2", "USER_gs_shell_init_module", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_handlers)); + fprintf(stdout, "\n xy2 registering USERSERVICE_custom_register_handlers completed!\n"); + + + return ifail; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/xy2/register_handler_head.h b/xy2/register_handler_head.h new file mode 100644 index 0000000..e84f856 --- /dev/null +++ b/xy2/register_handler_head.h @@ -0,0 +1,8 @@ +#pragma once +#include + +int POM_AM__set_application_bypass(logical bypass); +int jy_create_material_code(EPM_action_message_t msg); +int xy_assign_form_props(EPM_action_message_t msg); +int ORIGIN_EPM_auto_signoff(EPM_action_message_t msg); +int ORIGIN_EPM_check_and_signoff(EPM_action_message_t msg); \ No newline at end of file diff --git a/xy2/register_handler_methods.cpp b/xy2/register_handler_methods.cpp new file mode 100644 index 0000000..0eacaf7 --- /dev/null +++ b/xy2/register_handler_methods.cpp @@ -0,0 +1,117 @@ + +#include +#include +#include +#include +//#include "register_handler_head.h" +#include "register_handler_methods.h" + + +//供流程调用的 +// 标准的注册供流程调用服务handler的入口 TC_save_msg + + + +int USERSERVICE_custom_register_handlers(int* decision, va_list args) +{ + int ifail = ITK_ok, n = 0; + char date_buf[80], * expire_date, env[512], temp1[512], temp2[512]; + time_t now; + struct tm* p; + + *decision = ALL_CUSTOMIZATIONS; + + int status = ITK_ok; + + + + + (ifail = EPM_register_action_handler("Auto-Signoff-Info", "", (EPM_action_handler_t)ORIGIN_EPM_auto_signoff)); + if (ifail == 0) { + printf("Registering action handler Auto-Signoff-Info successful\n"); + } + else { + printf("Registering action handler Auto-Signoff-Info failed %d\n", ifail); + } + + + (ifail = EPM_register_action_handler("Check-And-Signoff", "", (EPM_action_handler_t)ORIGIN_EPM_check_and_signoff)); + if (ifail == 0) { + printf("Registering action handler Check-And-Signoff successful\n"); + } + else { + printf("Registering action handler Check-And-Signoff failed %d\n", ifail); + } + + + (ifail = EPM_register_action_handler("jy-create-material-code", "", (EPM_action_handler_t)jy_create_material_code)); + if (ifail == 0) { + printf("Registering action handler jy-create-material-code successful\n"); + } + else { + printf("Registering action handler jy-create-material-code failed %d\n", ifail); + } + + (ifail = EPM_register_action_handler("xy-assign-form-props", "", (EPM_action_handler_t)xy_assign_form_props)); + if (ifail == 0) { + printf("Registering action handler xy-assign-form-props successful\n"); + } + else { + printf("Registering action handler xy-assign-form-props failed %d\n", ifail); + } + + return ifail; +} + + +int Connor_open_bypass(void* returnValue) +{ + int ifail = ITK_ok; + char* propname; + ITKCALL(ifail = USERARG_get_string_argument(&propname)); + printf("propname=================%s\n", propname); + if (strcmp(propname, "true") == 0) { + POM_AM__set_application_bypass(TRUE); + } + else { + POM_AM__set_application_bypass(FALSE); + } + + return 0; +} + +// +//定义JAVA调用的服务 +//register service method +int USERSERVICE_custom_register_methods(int* decision, va_list args) +{ + + + int ifail = ITK_ok; + int status = ITK_ok, + numberOfArguments = 0, + returnValueType = USERARG_STRING_TYPE, + * argumentList = NULL; + USER_function_t functionPtr; + + //开旁路 + + numberOfArguments = 1; + functionPtr = Connor_open_bypass; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE; + + ITKCALL(status = USERSERVICE_register_method("setbypass", functionPtr, numberOfArguments, + argumentList, returnValueType)); + MEM_free(argumentList); + if (status == ITK_ok) + { + fprintf(stdout, "\n Registering setbypass finished\n"); + } + else + { + fprintf(stdout, "\n Registering setbypass failed %d\n", status); + } + return 0; +} \ No newline at end of file diff --git a/xy2/register_handler_methods.h b/xy2/register_handler_methods.h new file mode 100644 index 0000000..e1da3d5 --- /dev/null +++ b/xy2/register_handler_methods.h @@ -0,0 +1,27 @@ +#ifndef REGISTER_HANDLER_METHODS +#define REGISTER_HANDLER_METHODS + +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + + //extern DLLAPI int USERSERVICE_custom_register_handlers(int*, va_list); + //extern DLLAPI int USERSERVICE_custom_register_methods(int* decision, va_list args); + +int USERSERVICE_custom_register_handlers(int*, va_list); +int USERSERVICE_custom_register_methods(int* decision, va_list args); + +int POM_AM__set_application_bypass(logical bypass); +int jy_create_material_code(EPM_action_message_t msg); +int xy_assign_form_props(EPM_action_message_t msg); +int ORIGIN_EPM_auto_signoff(EPM_action_message_t msg); +int ORIGIN_EPM_check_and_signoff(EPM_action_message_t msg); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/xy2/resource.h b/xy2/resource.h new file mode 100644 index 0000000..a827897 --- /dev/null +++ b/xy2/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by xy2.rc + +// 新对象的下一组默认值 +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/xy2/service_part_no.cpp b/xy2/service_part_no.cpp new file mode 100644 index 0000000..bcbcf2e --- /dev/null +++ b/xy2/service_part_no.cpp @@ -0,0 +1,637 @@ +/** +* @addtogroup service +* @{ +*/ + +/** +* @file service_part_no.cpp +* @brief retrieve new item id according some mark code +* @date 2009/7/26 +* @author James Pang +* @history +* =================================================================================== +* Date Name Description +* 26-Jul-2009 James created +*/ +#pragma warning(disable:4819) +#pragma warning(disable:4267) + +/** +* @headerfile tcua 头文件 +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** +* @headerfile standard c & cpp header files +*/ +#include +#include +#include +#include +#include +#include + +/** +* @headerfile user's header files +*/ +#include "itk_service_common.h" +#include "error_handling.h" + + +#define CONSOLE_PRINT 1 + +/* Define the number of retries when fetching the next ID. */ +/* This must be stored in both numeric and string forms. */ + +#define GET_ID_RETRIES 10 +#define CYCLE_TIMES 10 +#define STARTNUMBER 1 +#define PADNUMBER 4 +#define RETRY_STRING "10" +#define HANDLE_ERROR_S1(E,S) \ +{ EMH_store_initial_error_s1(EMH_severity_error,(E),(S)); return(E); } + +#define REPORT_IFAIL(M) \ + ifail?printf("%s : ERROR : ifail = %d\n",M,ifail):printf("%s : Ok\n",M) + +#define HANDLE_ERROR(E) \ +{ EMH_store_initial_error(EMH_severity_error,(E)); return(E); } + +#define HANDLE_ERROR_S1(E,S) \ +{ EMH_store_initial_error_s1(EMH_severity_error,(E),(S)); return(E); } + +#define HANDLE_ERROR_AND_RELEASE(E,I) \ +{ \ + (void)release_number(I); \ + EMH_store_initial_error(EMH_severity_error,(E)); \ + return(E); \ +} + +#define TEST_ERROR(E) \ + if ((E) != ITK_ok) return(E); + +#define TEST_POM_ERROR(E) \ + if ((E) != ITK_ok) HANDLE_ERROR(E) + +#define TEST_ERROR_AND_RELEASE(E,I) \ + if ((E) != ITK_ok) { (void)release_number(I); return(E); } + +/* Define the number of retries when fetching the next ID. */ +/* This must be stored in both numeric and string forms. */ +#define GET_ID_RETRIES 10 +#define RETRY_STRING "10" + +/* Empty string test macro */ +#define IS_EMPTY(S) (!(*(S))) + +/* Define the methods by which a new item name can be obtained */ +#define SEED_METHOD 0 +#define BUILD_METHOD 1 + +/* The following define the maximum index number to be used. * +* Note that the actual maximum is one less than MAXNUM. * +* NUMERIC_LIMIT must be large enough to store decimal string * +* version of MAXNUM plus a NULL terminator. */ +#define NUMERIC_LIMIT 12 +#define MAXNUM 0x7FFFFFFF +/* define the class for which id and rev is generated */ +#define CLASS_IS_ITEM 0 +#define CLASS_IS_DATASET 1 +/* Store the tags for the next_id POM object and the actual ID attribute. */ +/* This saves us having to obtain these every time a user hits the Assign */ +/* button. The logical variables define whether the tags are legal or not. */ +/* I tried to set to tag_t's to NULLTAG for this purpose, but the HP C */ +/* compiler did not like this. Typical. */ +static logical inst_ok = false; +static logical attr_ok = false; +static tag_t instance; +static tag_t attr_id; +static logical is_new = false; +/*Store the class identifier for the id and rev generation. */ +/* This helps us share some of the existing codes */ +static int class_is = -1; + +/* Store all Item IDs issued, whether they are used or not.*/ +static int item_ids_issued = 0; +static char** item_ids_issued_list = NULL; +static char* ITEM_POM_CLASS = "ITEM"; + +/*------------------------------------------------------------------------------------------------------------------------------*/ + +/* +* +* int release_number ( tag_t instance ) +* +* Release the lock on the index number in the database. This is only +* CALLed in error situations. +* +* Parameters: +* instance The tag of the POM object to be released. This is +* returned by the load function. +* +*/ +static int release_number ( tag_t instance ) +{ + if (instance != NULLTAG) + { + return POM_refresh_instances_any_class(1, &instance, POM_no_lock); + } + else + { + return ITK_ok; + } +} /* end release_number */ + + +static int ORIGIN_select_counter ( const char *counter_name,int num ) +{ + int i, n; + tag_t class_id; + tag_t name_attr,num_attr; + tag_t *inst_tag; + char *value; + int num_value; + logical vNull, vEmpty; + int ifail; + + instance = NULLTAG; + attr_id = NULLTAG; + inst_ok = false; + attr_ok = false; + + /* Find the Next ID class */ + POM_class_id_of_class("ImanNextId", &class_id); + + + /* Find all the instances of this class */ + ITKCALL(ifail = POM_instances_of_class(class_id, false, &n, &inst_tag)) + + + /* Locate the appropriate attribute */ + ITKCALL(ifail = POM_attr_id_of_attr("name","ImanNextId", &name_attr)) + ITKCALL(ifail = POM_attr_id_of_attr ("next_id","ImanNextId",&num_attr)) + + /* Try to locate the named instance */ + for (i=0; ((i50) + return -1; + if(TeZhengMa==NULL) + return -1; + strcpy(pad_string,"\0"); + sprintf(str_num,"%d",curr_num); + printf("str_num = %s\n",str_num); + printf("strlen = %d\n",strlen(str_num)); + //new_name = (char*)malloc(sizeof(char)*100); + //strcpy(new_name,""); + if((num_len-(int)strlen(str_num))>0) + { + printf("111\n"); + pad_string[num_len-strlen(str_num)] = '\0'; + for(i=0;inumber) + { + ifail = POM_set_attr_int( 1, &instance, attr_id, start_num); + + //*sNum = start_num; + } + else + { + ifail = POM_set_attr_int( 1, &instance, attr_id, number+i); + //*sNum = number+i; + + } + + //TEST_POM_ERROR(ifail) + + ifail = POM_save_instances( 1, &instance, true ); + TEST_POM_ERROR(ifail); + + printf("sNum = %s\n",*sNum); + return ifail; +} + +int GetSeqNo(char* TeZhengMa, int length, int start_num, int end_num,int step,int *sNum) +{ + int ifail; + logical tagValid = false ; + int number; + int *rtn; + char counter_name[255]; + void *returnValueType; + sprintf(counter_name,"%s$%d$%d$%d$%d",TeZhengMa,length,start_num,end_num,step); + printf("counter_name = %s\n",counter_name); + + POM_is_tag_valid( instance , &tagValid); + + ifail = ORIGIN_select_counter(counter_name,start_num); + TEST_ERROR(ifail) + + ifail = load_current_number(counter_name,&number); + printf("counter number = %d\n",number); + if (!attr_ok) + { + ifail = get_next_id_attribute(); + TEST_ERROR(ifail) + } + if(is_new) + + ifail = POM_set_attr_int( 1, &instance, attr_id, start_num); + + else + { + if(number+step>end_num) + { + *sNum=number+step; + return -1; + } + ifail = POM_set_attr_int( 1, &instance, attr_id, number+step); + } + TEST_POM_ERROR(ifail) + + ifail = POM_save_instances( 1, &instance, true ); + TEST_POM_ERROR(ifail) + //(int*)returnValueType = number+step; + //printf("current_number = %d\n",number+step); + //printf("returnValueType = %d\n",returnValueType); + if(is_new) + *sNum = start_num; + else + *sNum = number+step; + + return ifail; + //return number+step; + //return ITK_ok; +} + + +int SERVICE_part_no( void *retValType ) +{ + int ifail = ITK_ok, i=0; + char + *argTeZhengMa=NULL, strTeZhengMa[ITEM_id_size_c + 1] = "", + *new_num=NULL, counter_name[256] = "", temp[ITEM_id_size_c + 1] = "", + *data = NULL; + int arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0, num = 0, rows = 0; + + //取得客户端java所传来的参数 + ifail = USERARG_get_string_argument(&argTeZhengMa); + ifail = USERARG_get_int_argument(&arg1); + ifail = USERARG_get_int_argument(&arg2); + ifail = USERARG_get_int_argument(&arg3); + ifail = USERARG_get_int_argument(&arg4); + + if(argTeZhengMa!=NULL) + { + strcpy(strTeZhengMa,argTeZhengMa); + } + + //调用自己的方法,参数来自Java + ifail = GetSeqNo(strTeZhengMa,arg1,arg2,arg3,arg4,&num); + TEST_ERROR(ifail) + + + sprintf(temp,"%d",num); + + do + { + i++; + ifail = generation_num(strTeZhengMa,arg1,num,&new_num); + + //char counter_name[256] = ""; + strcpy(counter_name,"%"); + strcat(counter_name,new_num); + strcat(counter_name,"%"); + ifail = EnqLikeNo(counter_name,&rows); + if ( rows != 0 ) + free(new_num); + + } while(rows!=0 && i<10000); + + if(num>arg3) + strcpy(temp,"Error: Current WaterNumber is out of Max Value!"); + else + sprintf(temp,"%s",new_num); + + //data = (char *) MEM_alloc ( sizeof(char)*(strlen(pszID) + 1 ) ); + printf("new_num= %s\n",new_num); + + data = (char *)MEM_alloc((ITEM_id_size_c + 1)*sizeof(char)); + strcpy( data, temp ); + *((char**) retValType) = data; + MEM_free(new_num); + + printf( "new itemid = %s\n", *(char**)retValType); + return ITK_ok; +} + +int SERVICE_internal_part_no( const char *argMark, int length, int start_num, int end_num,int step, char **newID ) +{ + int ifail = ITK_ok, i=0; + char + strTeZhengMa[ITEM_id_size_c + 1] = "", + *new_num=NULL, counter_name[256] = "", temp[ITEM_id_size_c + 1] = "", + *data = NULL; + int arg1 = length, arg2 = start_num, arg3 = end_num, arg4 = step, num = 0, rows = 0; + + if(argMark!=NULL) + { + strcpy( strTeZhengMa, argMark ); + } + + //调用自己的方法,参数来自Java + ifail = GetSeqNo(strTeZhengMa,arg1,arg2,arg3,arg4,&num); + TEST_ERROR(ifail) + sprintf(temp,"%d",num); + + do + { + i++; + ifail = generation_num(strTeZhengMa,arg1,num,&new_num); + + //char counter_name[256] = ""; + strcpy(counter_name,"%"); + strcat(counter_name,new_num); + strcat(counter_name,"%"); + ifail = EnqLikeNo(counter_name,&rows); + if ( rows != 0 ) + free(new_num); + + } while(rows!=0 && i<10000); + + if(num>arg3) + strcpy(temp,"Error: Current WaterNumber is out of Max Value!"); + else + sprintf(temp,"%s",new_num); + MEM_free(new_num); + + *newID = (char *)MEM_alloc((ITEM_id_size_c + 1)*sizeof(char)); + strcpy( *newID, temp ); + printf( "new itemid = %s\n", temp); + return ITK_ok; +} + + +/** +* @} +*/ \ No newline at end of file diff --git a/xy2/string_helper.cpp b/xy2/string_helper.cpp new file mode 100644 index 0000000..63080de --- /dev/null +++ b/xy2/string_helper.cpp @@ -0,0 +1,131 @@ +/** +* @file string_helper.cpp +* @brief string utility functions' implemention +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +*/ +#pragma warning(disable:4996) + +//#include +//#include +//#include +//#include "stdafx.h" +#include "string_helper.h" + +string TrimString( string strArg ) +{ + size_t index1 = 0; + index1 = strArg.find_first_not_of( ' '); + if( index1 != string::npos ) + strArg.erase( strArg.begin(), strArg.begin()+index1 ); + index1 = strArg.find_last_not_of( ' '); + if( index1 != string::npos ) + strArg.erase( strArg.begin() + index1 + 1 ); + return strArg; +} + +void Split( string strArg, char spliter, vector &ans ) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + while( strArg.size()>0 ) + { + index0 = strArg.find_first_of( spliter ); + if( index0 != string::npos ) + { + one_arg = strArg.substr( 0,index0 ); + strArg = strArg.substr( index0 + 1 ); + ans.push_back( one_arg ); + } + else + { + ans.push_back( strArg ); + break; + } + } +} + +void Split( string strArg, string spliter, vector &ans ) +{ + ans.clear(); + size_t index0; + string one_arg; + while( strArg.size()>0 ) + { + index0 = strArg.find(spliter); + if( index0 != string::npos ) + { + one_arg = strArg.substr( 0, index0 ); + strArg = strArg.substr( index0 + spliter.size() ); + ans.push_back( one_arg ); + } + else + { + ans.push_back( strArg ); + break; + } + } +} + +void RemoveLiner( string &in, string &out ) +{ + char buf[BUFSIZ] = ""; + for( int i=0; i<(int)in.size(); i++ ) + { + if( in[i] == '\n') + continue; + else + sprintf( buf,"%s%c", buf, in[i] ); + } + out.assign(buf); +} + +////Converting a WChar string to a Ansi string +//std::string WChar2Ansi(LPCWSTR pwszSrc) +//{ +// int nLen = WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, NULL, 0, NULL, NULL); +// +// if (nLen<= 0) return std::string(""); +// +// char* pszDst = new char[nLen]; +// if (NULL == pszDst) return std::string(""); +// +// WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, pszDst, nLen, NULL, NULL); +// pszDst[nLen -1] = 0; +// +// std::string strTemp(pszDst); +// delete [] pszDst; +// +// return strTemp; +//} +// +//string ws2s(wstring& inputws){ return WChar2Ansi(inputws.c_str()); } +// +////Converting a Ansi string to WChar string +//std::wstring Ansi2WChar(LPCSTR pszSrc, int nLen) +//{ +// int nSize = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszSrc, nLen, 0, 0); +// if(nSize <= 0) return NULL; +// +// WCHAR *pwszDst = new WCHAR[nSize+1]; +// if( NULL == pwszDst) return NULL; +// +// MultiByteToWideChar(CP_ACP, 0,(LPCSTR)pszSrc, nLen, pwszDst, nSize); +// pwszDst[nSize] = 0; +// +// if( pwszDst[0] == 0xFEFF) // skip Oxfeff +// for(int i = 0; i < nSize; i ++) +// pwszDst[i] = pwszDst[i+1]; +// +// wstring wcharString(pwszDst); +// delete pwszDst; +// +// return wcharString; +//} +// +//std::wstring s2ws(const string& s){ return Ansi2WChar(s.c_str(),s.size());} + diff --git a/xy2/string_helper.h b/xy2/string_helper.h new file mode 100644 index 0000000..62cc860 --- /dev/null +++ b/xy2/string_helper.h @@ -0,0 +1,26 @@ +/** +* @file string_helper.h +* @brief string utilities to help dealing with string +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +*/ + +#ifndef STRING_HELPER +#define STRING_HELPER + +#include +#include +using namespace std; +//extern string loginUser; +//extern string loginPassword; +string TrimString( string strArg ); +void Split( string strArg, char spliter, vector &ans ); +void Split( string strArg, string spliter, vector &ans ); +void RemoveLiner( string &in, string &out ); +//string ws2s(wstring& inputws); +//wstring s2ws(const string& s); + +#endif \ No newline at end of file diff --git a/xy2/x64/Release/common_itk_util.obj b/xy2/x64/Release/common_itk_util.obj new file mode 100644 index 0000000..9435aa4 Binary files /dev/null and b/xy2/x64/Release/common_itk_util.obj differ diff --git a/xy2/x64/Release/epm_auto_signoff_dataset.obj b/xy2/x64/Release/epm_auto_signoff_dataset.obj new file mode 100644 index 0000000..8a36222 Binary files /dev/null and b/xy2/x64/Release/epm_auto_signoff_dataset.obj differ diff --git a/xy2/x64/Release/jy_create_material_code.obj b/xy2/x64/Release/jy_create_material_code.obj new file mode 100644 index 0000000..7ecc3a4 Binary files /dev/null and b/xy2/x64/Release/jy_create_material_code.obj differ diff --git a/xy2/x64/Release/main_lib.obj b/xy2/x64/Release/main_lib.obj new file mode 100644 index 0000000..aee1bd0 Binary files /dev/null and b/xy2/x64/Release/main_lib.obj differ diff --git a/xy2/x64/Release/register_handler_methods.obj b/xy2/x64/Release/register_handler_methods.obj new file mode 100644 index 0000000..5706795 Binary files /dev/null and b/xy2/x64/Release/register_handler_methods.obj differ diff --git a/xy2/x64/Release/service_part_no.obj b/xy2/x64/Release/service_part_no.obj new file mode 100644 index 0000000..d202ab1 Binary files /dev/null and b/xy2/x64/Release/service_part_no.obj differ diff --git a/xy2/x64/Release/string_helper.obj b/xy2/x64/Release/string_helper.obj new file mode 100644 index 0000000..334a900 Binary files /dev/null and b/xy2/x64/Release/string_helper.obj differ diff --git a/xy2/x64/Release/vc142.pdb b/xy2/x64/Release/vc142.pdb new file mode 100644 index 0000000..f2c73b9 Binary files /dev/null and b/xy2/x64/Release/vc142.pdb differ diff --git a/xy2/x64/Release/xy2.Build.CppClean.log b/xy2/x64/Release/xy2.Build.CppClean.log new file mode 100644 index 0000000..9df12f2 --- /dev/null +++ b/xy2/x64/Release/xy2.Build.CppClean.log @@ -0,0 +1,11 @@ +d:\source\閿″帇\xy2\xy2\xy2\x64\release\vc142.pdb +d:\source\閿″帇\xy2\xy2\xy2\x64\release\xy_create_material_code.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\string_helper.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\service_part_no.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\main_lib.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\jy_create_material_code.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\epm_auto_signoff_dataset.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\common_itk_util.obj +d:\source\閿″帇\xy2\xy2\xy2\x64\release\xy2.tlog\cl.command.1.tlog +d:\source\閿″帇\xy2\xy2\xy2\x64\release\xy2.tlog\cl.read.1.tlog +d:\source\閿″帇\xy2\xy2\xy2\x64\release\xy2.tlog\cl.write.1.tlog diff --git a/xy2/x64/Release/xy2.dll.recipe b/xy2/x64/Release/xy2.dll.recipe new file mode 100644 index 0000000..57ed17f --- /dev/null +++ b/xy2/x64/Release/xy2.dll.recipe @@ -0,0 +1,11 @@ +锘 + + + + D:\source\閿″帇\xy2\xy2\x64\Release\xy2.dll + + + + + + \ No newline at end of file diff --git a/xy2/x64/Release/xy2.iobj b/xy2/x64/Release/xy2.iobj new file mode 100644 index 0000000..9962e43 Binary files /dev/null and b/xy2/x64/Release/xy2.iobj differ diff --git a/xy2/x64/Release/xy2.ipdb b/xy2/x64/Release/xy2.ipdb new file mode 100644 index 0000000..16c5ea0 Binary files /dev/null and b/xy2/x64/Release/xy2.ipdb differ diff --git a/xy2/x64/Release/xy2.log b/xy2/x64/Release/xy2.log new file mode 100644 index 0000000..6bf6caa --- /dev/null +++ b/xy2/x64/Release/xy2.log @@ -0,0 +1,139 @@ +锘 common_itk_util.cpp +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: 鈥淭eamcenter::RootObject::m_typeName鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::RootObject鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: 鈥淭eamcenter::RootObject::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::RootObject鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: 鈥淭eamcenter::OperationInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::OperationInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: 鈥淭eamcenter::BulkInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::BulkInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: 鈥淭eamcenter::BulkData::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::BulkData鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: 鈥淭eamcenter::DeepCopyData::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::DeepCopyData鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: 鈥淭eamcenter::CreateInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::CreateInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: 鈥淭eamcenter::SaveAsInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::SaveAsInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: 鈥淭eamcenter::BusinessObject::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::BusinessObject鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\extensionframework\OperationDispatcher.hxx(442,37): warning C4251: 鈥淭eamcenter::OperationDispatcher::m_boName鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::OperationDispatcher鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: 鈥淭eamcenter::POM_object::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::POM_object鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\tccore\imantype.hxx(225,25): warning C4251: 鈥淭eamcenter::ImanType::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::ImanType鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 + epm_auto_signoff_dataset.cpp +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(85,24): warning C4101: 鈥渞oot_template鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(572,9): warning C4101: 鈥渋Cnt鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(573,22): warning C4101: 鈥減TempStr鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(573,9): warning C4101: 鈥渦ser_lib_env鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(658,9): warning C4101: 鈥渋Cnt鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(659,22): warning C4101: 鈥減TempStr鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(659,9): warning C4101: 鈥渦ser_lib_env鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(752,9): warning C4101: 鈥渋Cnt鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(753,22): warning C4101: 鈥減TempStr鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(753,9): warning C4101: 鈥渦ser_lib_env鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1084,60): warning C4267: 鈥滃弬鏁扳: 浠庘渟ize_t鈥濊浆鎹㈠埌鈥渋nt鈥濓紝鍙兘涓㈠け鏁版嵁 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1292,9): warning C4101: 鈥渕_lpszDefaultDir鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1334,21): warning C4101: 鈥渄escription鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1378,12): warning C4101: 鈥渓ocal_path鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1411,15): warning C4101: 鈥渋Cnt鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1412,28): warning C4101: 鈥減TempStr鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1476,20): warning C4101: 鈥渘ew_file_descriptor鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1412,15): warning C4101: 鈥渦ser_lib_env鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 + jy_create_material_code.cpp +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: 鈥淭eamcenter::RootObject::m_typeName鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::RootObject鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: 鈥淭eamcenter::RootObject::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::RootObject鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: 鈥淭eamcenter::OperationInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::OperationInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: 鈥淭eamcenter::BulkInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::BulkInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: 鈥淭eamcenter::BulkData::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::BulkData鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: 鈥淭eamcenter::DeepCopyData::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::DeepCopyData鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: 鈥淭eamcenter::CreateInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::CreateInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: 鈥淭eamcenter::SaveAsInput::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::SaveAsInput鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: 鈥淭eamcenter::BusinessObject::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::BusinessObject鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\extensionframework\OperationDispatcher.hxx(442,37): warning C4251: 鈥淭eamcenter::OperationDispatcher::m_boName鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::OperationDispatcher鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: 鈥淭eamcenter::POM_object::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::POM_object鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\WorkEnvironment\tc14ITK\include_cpp\tccore\imantype.hxx(225,25): warning C4251: 鈥淭eamcenter::ImanType::name鈥: class鈥渟td::basic_string,std::allocator>鈥濋渶瑕佹湁 dll 鎺ュ彛鐢 class鈥淭eamcenter::ImanType鈥濈殑瀹㈡埛绔娇鐢 +C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 鍙傝鈥渟td::basic_string,std::allocator>鈥濈殑澹版槑 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(420,9): warning C4477: 鈥減rintf鈥: 鏍煎紡瀛楃涓测%d鈥濋渶瑕佺被鍨嬧渋nt鈥濈殑鍙傛暟锛屼絾鍙彉鍙傛暟 1 鎷ユ湁浜嗙被鍨嬧渦nsigned __int64鈥 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(420,9): message : 璇疯冭檻鍦ㄦ牸寮忓瓧绗︿覆涓娇鐢ㄢ%zd鈥 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(685,38): warning C4477: 鈥減rintf鈥: 鏍煎紡瀛楃涓测%d鈥濋渶瑕佺被鍨嬧渋nt鈥濈殑鍙傛暟锛屼絾鍙彉鍙傛暟 1 鎷ユ湁浜嗙被鍨嬧渦nsigned __int64鈥 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(685,38): message : 璇疯冭檻鍦ㄦ牸寮忓瓧绗︿覆涓娇鐢ㄢ%zd鈥 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(773,18): warning C4473: 鈥渟printf鈥: 娌℃湁涓烘牸寮忓瓧绗︿覆浼犻掕冻澶熺殑鍙傛暟 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(773,18): message : 鍗犱綅绗﹀拰鍏跺弬鏁伴璁 2 鍙彉鍙傛暟锛屼絾鎻愪緵鐨勫嵈鏄 1 鍙傛暟 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(773,18): message : 缂哄け鐨勫彲鍙樺弬鏁 2 涓烘牸寮忓瓧绗︿覆鈥%s鈥濇墍闇 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(892,17): warning C4477: 鈥渟printf鈥: 鏍煎紡瀛楃涓测%d鈥濋渶瑕佺被鍨嬧渋nt鈥濈殑鍙傛暟锛屼絾鍙彉鍙傛暟 1 鎷ユ湁浜嗙被鍨嬧渦nsigned __int64鈥 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(892,17): message : 璇疯冭檻鍦ㄦ牸寮忓瓧绗︿覆涓娇鐢ㄢ%zd鈥 +D:\source\閿″帇\xy2\xy2\xy2\jy_create_material_code.cpp(1017,22): warning C4101: 鈥減rotection鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 + main_lib.cpp +D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(804,1): warning C4819: 璇ユ枃浠跺寘鍚笉鑳藉湪褰撳墠浠g爜椤(936)涓〃绀虹殑瀛楃銆傝灏嗚鏂囦欢淇濆瓨涓 Unicode 鏍煎紡浠ラ槻姝㈡暟鎹涪澶 +D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(5422,1): warning C4819: 璇ユ枃浠跺寘鍚笉鑳藉湪褰撳墠浠g爜椤(936)涓〃绀虹殑瀛楃銆傝灏嗚鏂囦欢淇濆瓨涓 Unicode 鏍煎紡浠ラ槻姝㈡暟鎹涪澶 + register_handler_methods.cpp +D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(804,1): warning C4819: 璇ユ枃浠跺寘鍚笉鑳藉湪褰撳墠浠g爜椤(936)涓〃绀虹殑瀛楃銆傝灏嗚鏂囦欢淇濆瓨涓 Unicode 鏍煎紡浠ラ槻姝㈡暟鎹涪澶 +D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(5422,1): warning C4819: 璇ユ枃浠跺寘鍚笉鑳藉湪褰撳墠浠g爜椤(936)涓〃绀虹殑瀛楃銆傝灏嗚鏂囦欢淇濆瓨涓 Unicode 鏍煎紡浠ラ槻姝㈡暟鎹涪澶 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(19,9): warning C4101: 鈥渘ow鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(18,58): warning C4101: 鈥渢emp2鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(18,23): warning C4101: 鈥渆xpire_date鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(18,7): warning C4101: 鈥渄ate_buf鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(20,15): warning C4101: 鈥減鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(18,36): warning C4101: 鈥渆nv鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\register_handler_methods.cpp(18,46): warning C4101: 鈥渢emp1鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 + service_part_no.cpp +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(304,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(307,9): warning C4477: 鈥減rintf鈥: 鏍煎紡瀛楃涓测%d鈥濋渶瑕佺被鍨嬧渋nt鈥濈殑鍙傛暟锛屼絾鍙彉鍙傛暟 1 鎷ユ湁浜嗙被鍨嬧渟ize_t鈥 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(307,9): message : 璇疯冭檻鍦ㄦ牸寮忓瓧绗︿覆涓娇鐢ㄢ%zd鈥 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(305,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(322,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(332,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(351,4): warning C4101: 鈥渇ailed_instances鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(346,17): warning C4101: 鈥渘_failtures鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(354,21): warning C4101: 鈥渏鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(354,18): warning C4101: 鈥渋鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(350,4): warning C4101: 鈥渋nstances鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(346,6): warning C4101: 鈥渘_instance鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(428,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(429,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(430,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(426,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(402,8): warning C4101: 鈥渞eturnValueType鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(399,7): warning C4101: 鈥渞tn鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(482,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(481,8): warning C4101: 鈥渞eturnValueType鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(479,7): warning C4101: 鈥渞tn鈥: 鏈紩鐢ㄧ殑灞閮ㄥ彉閲 +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(546,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(562,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(563,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(564,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(572,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(580,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(554,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(574,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(599,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(613,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(614,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(615,3): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(623,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(629,2): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(605,2): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +D:\source\閿″帇\xy2\xy2\xy2\service_part_no.cpp(625,3): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + string_helper.cpp + xy_create_material_code.cpp +D:\source\閿″帇\xy2\xy2\xy2\xy_create_material_code.cpp(476,17): warning C4477: 鈥渟printf鈥: 鏍煎紡瀛楃涓测%d鈥濋渶瑕佺被鍨嬧渋nt鈥濈殑鍙傛暟锛屼絾鍙彉鍙傛暟 1 鎷ユ湁浜嗙被鍨嬧渦nsigned __int64鈥 +D:\source\閿″帇\xy2\xy2\xy2\xy_create_material_code.cpp(476,17): message : 璇疯冭檻鍦ㄦ牸寮忓瓧绗︿覆涓娇鐢ㄢ%zd鈥 + 姝e湪鐢熸垚浠g爜 + Previous IPDB not found, fall back to full compilation. + All 68 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. + 宸插畬鎴愪唬鐮佺殑鐢熸垚 + xy2.vcxproj -> D:\source\閿″帇\xy2\xy2\x64\Release\xy2.dll diff --git a/xy2/x64/Release/xy2.res b/xy2/x64/Release/xy2.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/xy2/x64/Release/xy2.res differ diff --git a/xy2/x64/Release/xy2.tlog/CL.command.1.tlog b/xy2/x64/Release/xy2.tlog/CL.command.1.tlog new file mode 100644 index 0000000..99a7db5 Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/CL.command.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/CL.read.1.tlog b/xy2/x64/Release/xy2.tlog/CL.read.1.tlog new file mode 100644 index 0000000..e1c3bbe Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/CL.read.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/CL.write.1.tlog b/xy2/x64/Release/xy2.tlog/CL.write.1.tlog new file mode 100644 index 0000000..ca3558d Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/CL.write.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/link.command.1.tlog b/xy2/x64/Release/xy2.tlog/link.command.1.tlog new file mode 100644 index 0000000..5799ea3 Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/link.command.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/link.read.1.tlog b/xy2/x64/Release/xy2.tlog/link.read.1.tlog new file mode 100644 index 0000000..7e7aa34 Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/link.read.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/link.write.1.tlog b/xy2/x64/Release/xy2.tlog/link.write.1.tlog new file mode 100644 index 0000000..3fe5817 Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/link.write.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/rc.command.1.tlog b/xy2/x64/Release/xy2.tlog/rc.command.1.tlog new file mode 100644 index 0000000..ab7328b Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/rc.command.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/rc.read.1.tlog b/xy2/x64/Release/xy2.tlog/rc.read.1.tlog new file mode 100644 index 0000000..59bc79c Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/rc.read.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/rc.write.1.tlog b/xy2/x64/Release/xy2.tlog/rc.write.1.tlog new file mode 100644 index 0000000..d95a4ae Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/rc.write.1.tlog differ diff --git a/xy2/x64/Release/xy2.tlog/xy2.lastbuildstate b/xy2/x64/Release/xy2.tlog/xy2.lastbuildstate new file mode 100644 index 0000000..cbe8ad6 --- /dev/null +++ b/xy2/x64/Release/xy2.tlog/xy2.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\source\閿″帇\xy2\xy2\| diff --git a/xy2/x64/Release/xy2.tlog/xy2.write.1u.tlog b/xy2/x64/Release/xy2.tlog/xy2.write.1u.tlog new file mode 100644 index 0000000..1bd411d Binary files /dev/null and b/xy2/x64/Release/xy2.tlog/xy2.write.1u.tlog differ diff --git a/xy2/x64/Release/xy2.vcxproj.FileListAbsolute.txt b/xy2/x64/Release/xy2.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/xy2/x64/Release/xy_create_material_code.obj b/xy2/x64/Release/xy_create_material_code.obj new file mode 100644 index 0000000..d4281b3 Binary files /dev/null and b/xy2/x64/Release/xy_create_material_code.obj differ diff --git a/xy2/xy2.aps b/xy2/xy2.aps new file mode 100644 index 0000000..70c0f49 Binary files /dev/null and b/xy2/xy2.aps differ diff --git a/xy2/xy2.rc b/xy2/xy2.rc new file mode 100644 index 0000000..0fded0b --- /dev/null +++ b/xy2/xy2.rc @@ -0,0 +1,60 @@ +// Microsoft Visual C++ 生成的资源脚本。 +// + +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// 从 TEXTINCLUDE 2 资源生成。 +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// 中文(简体,中国) 资源 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 4, 2 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // 中文(简体,中国) 资源 +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// 从 TEXTINCLUDE 3 资源生成。 +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // 不是 APSTUDIO_INVOKED diff --git a/xy2/xy2.vcxproj b/xy2/xy2.vcxproj new file mode 100644 index 0000000..1618907 --- /dev/null +++ b/xy2/xy2.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + 16.0 + Win32Proj + {ea48841c-4b5f-4555-b8f9-4e2ce1ed35ef} + xy2 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + + + WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions) + false + D:\WorkEnvironment\tc14ITK\include;D:\WorkEnvironment\tc14ITK\include_cpp;%(AdditionalIncludeDirectories) + + + Console + true + true + true + D:\WorkEnvironment\tc14ITK\lib + D:\WorkEnvironment\tc14ITK\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib + + + + + + \ No newline at end of file diff --git a/xy2/xy2.vcxproj.filters b/xy2/xy2.vcxproj.filters new file mode 100644 index 0000000..e2561a9 --- /dev/null +++ b/xy2/xy2.vcxproj.filters @@ -0,0 +1,74 @@ +锘 + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {1c86beb0-ba33-4f2f-8c71-74ecb379da02} + + + + + 澶存枃浠 + + + 澶存枃浠 + + + common + + + common + + + common + + + common + + + 澶存枃浠 + + + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + common + + + common + + + common + + + + + 璧勬簮鏂囦欢 + + + \ No newline at end of file diff --git a/xy2/xy2.vcxproj.user b/xy2/xy2.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/xy2/xy2.vcxproj.user @@ -0,0 +1,4 @@ +锘 + + + \ No newline at end of file diff --git a/xy2/xy_create_material_code.cpp b/xy2/xy_create_material_code.cpp new file mode 100644 index 0000000..7e0fc5d --- /dev/null +++ b/xy2/xy_create_material_code.cpp @@ -0,0 +1,608 @@ +/** +* @addtogroup workflow +* @{ +*/ + +/** +* @file xy_create_material_code.cpp +* +* @brief create material code according to some rev master properties +* +* @author Ray Li +* +* @history +* =================================================================================== +* Date Name Description +* 27-Jul-2009 Ray created + +*/ + +/** +* @remarks: handler usage description +* +* @Handler: xy-create-material-code +* +* @Description: This handler will assign some value to its form property +* +* @Syntax: xy-create-material-code -type=产品,零组件 -required_props=prop1,prop2,prop3 -sid_leng=3 -target_prop=target_prop_name [-debug=true|false] +* @Arguments: -type = ItemRevision types, like 产品,零组件 +* specified target ItemRevision will be processed, others skipped, +* eg: 产品,零组件 +* +* -target_prop = target property +* the new prop value assigned to this property +* +* -target_value = target property +* the new prop value assigned to this property +* +* -debug = true | false +* When the argument is set to 'true' (case-insensitive), there will be more messages written in the syslog file. The default value is false. +* +* @Placement: not specified +* +* @Restrictions: none +* +*/ + +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) + +/** +* @headerfile tcua 头文件 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** +* @headerfile standard c & cpp header files +*/ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +//#include +using namespace std; + +/** +* @headerfile user's header files +*/ + + +#include "string_helper.h" +#include "itk_service_common.h" +#include "register_handler_methods.h" +#include "error_handling.h" + +static int CycleLovFilter( tag_t lov_tag, const char *prop_value, int lov_order, int filter_level, string &prop_desc ) +{ + int ifail = ITK_ok; + + if (lov_tag == NULLTAG) + return ITK_ok; + else if ( prop_desc.size()==0 ) + { + if (filter_level == lov_order) + { + int n_values = 0, lov_index = 0; + char **lov_values = NULL; + logical find_prop_value = FALSE; + + ITKCALL( LOV_ask_values_string( lov_tag, &n_values, &lov_values ) ); + for (int li=0; li0) + { + for (int li=0; li0) + prop_value.assign(prop_desc); + } + + if (prop_value.size()==0) + { + prop_value.assign(str_value); + } + + MEM_free(str_value); + return ITK_ok; + } + } + } + else if (prop_type == PROP_int) + { + int int_value = NULL; + ITKCALL( AOM_ask_value_int( object, prop_name, &int_value ) ); + char buf[100] = ""; + sprintf( buf, "%d", int_value ); + prop_value.assign(buf); + } + } + + return ITK_ok; +} + + + + +int xy_assign_form_props(EPM_action_message_t msg) +{ + int ifail = ITK_ok; + logical is_debug = FALSE; + char buf[BUFSIZ] = "", *flag = NULL, *value = NULL; + + //item master form relation type + tag_t master_form_rel_type = NULLTAG; + ITKCALL( GRM_find_relation_type( TC_master_form_rtype, &master_form_rel_type ) ); + + //parse some arguments + map item_types_map; + map::iterator item_types_map_iter = item_types_map.begin(); + vector required_props_vec; + int sid_leng = 0, max_sid = 0; + char target_prop[WSO_name_size_c + 1] = ""; + char target_value[WSO_name_size_c + 1] = ""; + int num_of_arguments = TC_number_of_arguments( msg.arguments ); + for (int i=0; i ans; + Split( value, ',', ans ); + for (size_t j=0; j ans; + // Split( value, ',', ans ); printf( "ans size = %d\n", ans.size() ); + // for (size_t j=0; jfirst.c_str(), NULL, &item_type ) ); + // ITKCALL( TCTYPE_ask_class_name( item_type, item_type_class ) ); + // if (strcmp( item_type_class, "Item" ) != 0) + // { + // sprintf( buf, "type %s not Item or its sub type%s\n", item_types_map_iter->first.c_str() ); + // LOG_ECHO( (buf) ); + // break; + // } + + // char *rev_master_type_name = NULL; + // ITKCALL( ITEM_ask_rev_master_form_type( item_types_map_iter->first.c_str(), &rev_master_type_name ) ); + + // tag_t rev_master_type = NULLTAG; + // ITKCALL( TCTYPE_find_type( rev_master_type_name, NULL, &rev_master_type ) ); + + // for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + // { + // char one_prop[WSO_name_size_c + 1] = ""; + // strcpy( one_prop, required_props_vec[ri].c_str() ); + + // tag_t pd_tag = NULLTAG; + // ifail = TCTYPE_ask_property_by_name( rev_master_type, one_prop, &pd_tag ); + // if (ifail != ITK_ok || pd_tag == NULLTAG) + // { + // sprintf( buf, "property %s not found from type %s\n", one_prop, rev_master_type_name ); + // LOG_ECHO( (buf) ); + + // prop_not_defined = TRUE; + // break; + // } + // } + + // if (!prop_not_defined) + // { + // tag_t pd_tag = NULLTAG; + // ifail = TCTYPE_ask_property_by_name( rev_master_type, target_prop, &pd_tag ); + // if (ifail != ITK_ok || pd_tag == NULLTAG) + // { + // sprintf( buf, "property %s not found from type %s\n", target_prop, rev_master_type_name ); + // LOG_ECHO( (buf) ); + + // prop_not_defined = TRUE; + // break; + // } + // } + + // if (prop_not_defined) + // { + // break; + // } + //} + + //if (prop_not_defined) + //{ + // return PROP_no_properties; + //} + + //if ( is_debug ) //print arguments specified for handler + //{ + // item_types_map_iter = item_types_map.begin(); + // for (; item_types_map_iter!=item_types_map.end(); item_types_map_iter++) + // { + // sprintf( buf, "Type: %s, ", item_types_map_iter->first.c_str() ); + // LOG_ECHO( (buf) ); + // } + // sprintf( buf, "\n" ); + // LOG_ECHO( (buf) ); + + // for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + // { + // sprintf( buf, "Prop: %s, ", required_props_vec[ri].c_str() ); + // LOG_ECHO( (buf) ); + // } + // sprintf( buf, "Prop: %s\n", target_prop ); + // LOG_ECHO( (buf) ); + + // sprintf( buf, "Max Flow ID Leng: %d\n", max_sid ); + // LOG_ECHO( (buf) ); + //} + +//STEP 2: + //retrieve item revisions related in reference's list + tag_t job = NULLTAG, root_task = NULLTAG; + ITKCALL( EPM_ask_job( msg.task, &job ) ); + ITKCALL( EPM_ask_root_task( job, &root_task ) ); + + //current task's reference list + int reference_count = 0; + tag_t *reference_list = NULL; + ITKCALL( EPM_ask_attachments( root_task, EPM_target_attachment, &reference_count, &reference_list ) ); + vector reference_revs_vec; + for (int ri=0; ri prop_type_map; + map::iterator prop_type_map_iter; + ////得到指定属性的值类型 + //for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + //{ + // PROP_value_type_t valtype; + // char *valtype_n = NULL; + // ITKCALL( AOM_ask_value_type( master_form, required_props_vec[ri].c_str(), &valtype, &valtype_n ) ); + // if (is_debug) + // { + // sprintf( buf, "prop type = %s\n", valtype_n ); + // } + // MEM_free(valtype_n); + // prop_type_map.insert( make_pair(required_props_vec[ri], valtype) ); + //} + + /*得到指定的属性 + string material_code_mark(""); + for ( int ri=0; ri<(int)required_props_vec.size(); ri++) + { + prop_type_map_iter = prop_type_map.find(required_props_vec[ri]); + PROP_value_type_t valtype = prop_type_map_iter->second; + + string prop_value; + FindPropLovDesc( master_form, required_props_vec[ri].c_str(), valtype, prop_value ); + if (prop_value.size()>0) + { + material_code_mark.append(prop_value); + } + } + + char *newID = NULL; + ITKCALL( SERVICE_internal_part_no( material_code_mark.c_str(), sid_leng, 1, max_sid, 1, &newID ) ); + if (newID && *newID && strlen(newID)>0) + { + material_code_mark.assign(newID); + MEM_free(newID); + } + + if (is_debug) + { + sprintf( buf, "new material code is %s\n", material_code_mark.c_str() ); + LOG_ECHO( (buf) ); + }*/ + + //检查写权限 + printf("7777777\n"); + logical can_change_form = FALSE; + ITKCALL( AM_check_privilege( master_form, "WRITE", &can_change_form ) ); + if (can_change_form) + { + //PROP_value_type_t valtype; + //char *valtype_n = NULL; + //ITKCALL( AOM_ask_value_type( master_form, target_prop, &valtype, &valtype_n ) ); + //if (is_debug) + //{ + // sprintf( buf, "prop type = %s\n", valtype_n ); + //} + //MEM_free(valtype_n); + //if (valtype == PROP_string) + //{ + // tag_t prop_descriptor = NULLTAG; + // ITKCALL( AOM_ask_descriptor( object, prop_name, &prop_descriptor ) ); + + // logical is_lov_des_attached = FALSE; + // ITKCALL( PROPDESC_is_lov_desc_attach( prop_descriptor, &is_lov_des_attached ) ); + // if (is_lov_des_attached) //如果当前属性已经是lov的描述,则不再处理,仅赋值给返回对象 + // { + // //char *str_value = NULL; + // //ITKCALL( AOM_ask_value_string( object, prop_name, &str_value ) ); + // //if (str_value && *str_value) + // //{ + // // prop_value.assign(str_value); + // // MEM_free(str_value); + // //} + // } + //} + //TC8============= + //ITKCALL( AOM_lock( master_form ) ); + + //ITKCALL( AOM_set_value_string( master_form, target_prop, material_code_mark.c_str() ) ); + ITKCALL(RES_checkout2(master_form,"","","",RES_EXCLUSIVE_RESERVE)); + ITKCALL(RES_cancel_checkout (master_form,false)); + ITKCALL( AOM_set_value_string( master_form, target_prop, target_value ) ); + ITKCALL( AOM_save( master_form ) ); + ITKCALL( AOM_unlock( master_form ) ); + } + else + { + printf( ("reviewer has no write privilege to add attachment\n" ) ); + return AM_insufficient_access; + } + } + + return ITK_ok; +} +