20231222 commit

main
李建辉 2 years ago
commit 13379ada3f

@ -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 <tccore/imantype.hxx>
#include <ae/datasettype.h>
#include <time.h>
#include<tc/tc_macros.h>
#include <tccore/tctype.h>
#include<tccore/workspaceobject.h>
#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; i<ref_count; i++ )
{
if( stricmp( ref_formats[i], "BINARY" ) == 0 )
break;
}
if( i<ref_count )
{
strcpy( ext, ref_templates[i] + 2 );
}
MEM_free( ref_templates );
MEM_free( ref_formats );
return ITK_ok;
}
int CompareDate( date_t date1, date_t date2 )
{
int comp_ret = 0;
char str_date1[30] = "";
char str_date2[30] = "";
sprintf( str_date1, "%d%2d%2d%2d%2d%2d", date1.year, date1.month, date1.day,
date1.hour, date1.minute, date1.second );
sprintf( str_date2, "%d%2d%2d%2d%2d%2d", date2.year, date2.month, date2.day,
date2.hour, date2.minute, date2.second );
comp_ret = strcmp( str_date1, str_date2 );
return comp_ret;
}
int GetRandomTempFile( char tempFile[256] )
{
time_t now;
srand( (unsigned)time(&now) );
struct tm *p = localtime(&now);
sprintf( tempFile, "TEMP%d%d%d%d%d%d-%d", p->tm_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;
}

@ -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<tccore/workspaceobject.h>
#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

File diff suppressed because it is too large Load Diff

@ -0,0 +1,130 @@
/*!
* @addtogroup common
* \file error_handling.h
* \brief
* \date 2008/6/10
* \author James Pang
*/
#ifndef SIMPLE_ERR_H_INCLUDED
#define SIMPLE_ERR_H_INCLUDED
//! @headerfile Tceng ITK 头文件
#include <pom/pom/pom_errors.h>
#include <base_utils/mem.h>
#include <tc/emh.h>
#include <common/emh_const.h>
#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<n_ifails; err_count++ ) \
{ \
printf( "ERROR: %d ERROR MSG: %s.\n", ifails[i], texts[i] ); \
} \
MEM_free( serverities ); \
MEM_free( ifails ); \
MEM_free( texts ); \
return (stat); \
} \
} \
#define CHECK_FILE(x,ret) { \
FILE *stream = NULL; \
if( (stream = fopen(x,"rb")) == NULL ) { \
printf( "%s doesn't exists, please check!\n", x ); \
IMAN_write_syslog( "%s doesn't exists, please check!\n", x) ; \
ret = -1; \
} \
else { \
fclose(stream); \
stream = NULL; \
ret = 0; \
} \
} \
//check file not exists
#define CHECK_FILE_NOT_EXISTS(x,ret) { \
FILE *stream = NULL; \
if( (stream = fopen(x,"rb")) != NULL ) { \
fclose(stream); \
stream = NULL; \
printf( "%s exists, please check!\n", x ); \
IMAN_write_syslog( "%s exists, please check!\n", x) ; \
ret = -1; \
} \
else { \
ret = 0; \
} \
} \
#define HANDLER_ARGUMENT_ERROR EMH_USER_error_base + 1
#define WORKFLOW_NODE_IS_NOT_VALID EMH_USER_error_base + 2
#define HANDLER_PLACED_INVALID EMH_USER_error_base + 3
//////////////////////////////////////////////////////////////////////////
#endif //End of error_hanling.h

@ -0,0 +1,40 @@
/**
* @addtogroup service
* @{
*/
/**
* @file itk_service_common.cpp
* @brief declarion of all custom service exits functions
* @date 2009/2/13
* @author James Pang
* @history
* ===================================================================================
* Date Name Description
* 13-Feb-2009 James created
*/
#ifndef ITK_SERVICE_COMMON
#define ITK_SERVICE_COMMON
#ifdef __cplusplus
extern "C" {
#endif
int GetFolderTagandCreate (void * returnValueType);
int SERVICE_part_no( void *retValType );
int SERVICE_internal_part_no( const char *argMark, int length, int start_num, int end_num,int step, char **newID /*OF*/);
int SERVICE_parts_frequency( void *revValType );
int SERVICE_get_lov_desc( void* revValType );
#ifdef __cplusplus
}
#endif
#endif
/**
* @}
*/

File diff suppressed because it is too large Load Diff

@ -0,0 +1,43 @@
/**
* @headerfile tcua
*/
#include <server_exits/user_server_exits.h>
#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

@ -0,0 +1,8 @@
#pragma once
#include <epm/epm.h>
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);

@ -0,0 +1,117 @@
#include <tccore/custom.h>
#include <server_exits/user_server_exits.h>
#include <tccore/item_msg.h>
#include <epm/epm.h>
//#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;
}

@ -0,0 +1,27 @@
#ifndef REGISTER_HANDLER_METHODS
#define REGISTER_HANDLER_METHODS
#include <epm/epm.h>
#include <tccore/custom.h>
#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

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

@ -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 <ict/ict_userservice.h>
#include <ae/dataset.h>
#include <ae/datasettype.h>
#include <tccore/grmtype.h>
#include <tccore/grm.h>
#include <tccore/item.h>
#include <tccore/aom.h>
#include <tc/folder.h>
#include <sa/user.h>
#include <pom/enq/enq.h>
/**
* @headerfile standard c & cpp header files
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include<tc/tc_macros.h>
/**
* @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; ((i<n)&&(instance==NULLTAG)); i++)
{
ITKCALL(ifail = POM_refresh_instances_any_class(1, &(inst_tag[i]), POM_no_lock))
ITKCALL(ifail = POM_ask_attr_string(inst_tag[i], name_attr, &value,&vNull, &vEmpty))
if ((ifail == ITK_ok) &&
(!vNull) &&
(!vEmpty) &&
(strcmp(value, counter_name) == 0))
{
instance = inst_tag[i];
ITKCALL(ifail = POM_ask_attr_int (inst_tag[i],num_attr,&num_value,&vNull,&vEmpty))
printf("num_value=%d\n",num_value);
ITKCALL(ifail = POM_attr_id_of_attr("next_id","ImanNextId", &num_attr))
printf("num_attr=%d\n",num_attr);
printf("inst_tag[i]=%d\n",inst_tag[i]);
is_new = false;
}
}
//如果没有查到计数器,则创建一个计数器
if( instance == NULLTAG )
{
ITKCALL(ifail = POM_class_id_of_class("ImanNextId", &class_id))
if (ifail != ITK_ok)
return ifail;
ITKCALL(ifail = POM_attr_id_of_attr("name", "ImanNextId", &attr_id))
if (ifail != ITK_ok)
return ifail;
ITKCALL(ifail = POM_attr_id_of_attr("next_id","ImanNextId", &num_attr))
if (ifail != ITK_ok)
return ifail;
ITKCALL(ifail = POM_create_instance(class_id, &instance))
if (ifail != ITK_ok)
return ifail;
ITKCALL(ifail = POM_set_attr_string(1, &instance, attr_id, counter_name))
if (ifail != ITK_ok)
return ifail;
ITKCALL(ifail = POM_set_attr_int (1,&instance,num_attr,num))
if (ifail != ITK_ok)
return ifail;
ITKCALL(ifail = POM_save_instances(1, &instance, true))
ITKCALL(ifail = POM_refresh_instances_any_class(1, &instance, POM_no_lock))
printf( "No instance, create one\n" );
is_new = true;
}
inst_ok = true;
return(ITK_ok);
}
static int get_next_id_attribute(void)
{
int ifail;
attr_id = NULLTAG;
attr_ok = false;
ITKCALL(ifail = POM_attr_id_of_attr("next_id","ImanNextId", &attr_id))
TEST_POM_ERROR(ifail)
attr_ok = true;
return(ITK_ok);
}
static int load_current_number (const char *counter_name , int *num )
{
int i;
logical vNull, vEmpty;
int ifail;
int temp;
logical tagValid = false ;
*num = 0;
POM_is_tag_valid( instance , &tagValid);
if (!inst_ok || !tagValid )
{
ifail = ORIGIN_select_counter(counter_name, 1);
TEST_ERROR(ifail)
}
/* Try to load and lock the instance */
ifail = ITK_ok+1;
for (i=0; ((i<GET_ID_RETRIES) && (ifail!=ITK_ok)); i++)
ifail = POM_refresh_instances_any_class(1, &instance, POM_modify_lock);
if (i == GET_ID_RETRIES)
{
//if (class_is==CLASS_IS_ITEM)
// HANDLE_ERROR_S1(ITEM_next_id_lock_failed,RETRY_STRING)
//else if (class_is==CLASS_IS_DATASET)
// HANDLE_ERROR_S1(AE_next_id_lock_failed,RETRY_STRING)
}
TEST_POM_ERROR(ifail)
if (!attr_ok)
{
ifail = get_next_id_attribute();
TEST_ERROR(ifail)
}
ifail = POM_ask_attr_int(instance, attr_id, &temp, &vNull, &vEmpty);
TEST_POM_ERROR(ifail)
*num = temp;
return(ITK_ok);
} /* end load_number */
static int generation_num(char *TeZhengMa,int num_len,int curr_num,char **final_num)
{
int i=0;
char pad_string[64],str_num[64];
char *new_name=NULL;
if(num_len<0 || num_len>50)
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;i<num_len-strlen(str_num);i++)
{
pad_string[i] = '0';
}
//pad_string[i+1]='\0';
*final_num = (char *)MEM_alloc(sizeof(char)*100);
//strcpy(*final_num,"");
sprintf(*final_num, "%s%s%s", TeZhengMa, pad_string,str_num);
//sprintf(new_name, "%s%s%s", TeZhengMa, pad_string,str_num);
//*final_num = new_name;
printf("final_num1 = %s\n",*final_num);
}
else
{
printf("222\n");
*final_num = (char *)MEM_alloc(sizeof(char)*100);
sprintf(*final_num, "%s%s", TeZhengMa, str_num);
//sprintf(new_name, "%s%s", TeZhengMa, str_num);
printf("*final_num = %s\n",*final_num);
//*final_num = new_name;
//return -1;
}
return 0;
}
static int EnqLikeNo(char* TeZhengManWithNumber,int* num)
{
int ifail;
int n_instance,n_failtures;
tag_t
enquiry_id = NULLTAG,
class_to_load_as = NULLTAG,
*instances,
*failed_instances;
char *enquiryLikeItem = "Select_ITEM";
char *select_attrs[1] = { "puid" };
int rows, cols, i, j;
void ***report = NULL;
//===============select puid form Item where ITEM_ID like TeZhengManWithNumber%
printf("creat select\n");
ITKCALL( POM_enquiry_create( enquiryLikeItem ) );
printf("search:%s\n",TeZhengManWithNumber);
ITKCALL( POM_enquiry_add_select_attrs( enquiryLikeItem, ITEM_POM_CLASS, 1, (const char**) select_attrs ) );
//"PartIdRev","PmiName",
ITKCALL( POM_enquiry_set_string_value( enquiryLikeItem, "item_id_value", 1, (const char**)( &TeZhengManWithNumber ), POM_enquiry_asc_order ) );
//ITKCALL( POM_enquiry_set_string_value( enquiryLikeItem, "item_id_value", 1,"myTeZhengMa1014%", POM_enquiry_bind_value ) );
ITKCALL( POM_enquiry_set_attr_expr( enquiryLikeItem, "item_id_exp", ITEM_POM_CLASS, "ITEM_ID", POM_enquiry_like, "item_id_value" ) );
//ITKCALL( POM_enquiry_set_string_value( enquiryLikeItem, "pmi_id_value", 1, (const char**)( &szPmiId ), POM_enquiry_bind_value ) );
//ITKCALL( POM_enquiry_set_attr_expr( enquiryLikeItem, "pmi_id_exp", ITEM_POM_CLASS, "PmiId", POM_enquiry_equal, "pmi_id_value" ) );
//ITKCALL( POM_enquiry_set_expr( enquiryLikeItem, "filter_exp", "item_id_exp", POM_enquiry_and, "pmi_id_exp" ) );
ITKCALL( POM_enquiry_set_where_expr( enquiryLikeItem, "item_id_exp" ) );
printf("execute select\n");
ITKCALL( POM_enquiry_execute( enquiryLikeItem, &rows, &cols, &report ) );
printf("executed select\n");
*num= rows;
/* for( i=0; i<rows; i++ )
{
for( j=0; j<cols; j++ )
{
MEM_free( report[i][j] );
}
MEM_free( report[i] );
}
MEM_free( report );*/
MEM_free( report );
//ITKCALL( POM_load_instances_possible_by_enquiry( enquiryLikeItem, ITEM_POM_CLASS, &n_instance, &instances, &n_failtures, &failed_instances ) );
ITKCALL( ifail = POM_enquiry_delete( enquiryLikeItem ) );
printf("ifail=%d\n",ifail);
printf("rows=%d\n",rows);
return ifail;
}
int SaveCounter(char* TeZhengMa, int length, int start_num, int end_num,int step,char **sNum)
{
int ifail;
logical tagValid = false ;
int number,rows,i=0;
int *rtn;
char *new_num=NULL;
char counter_name[255];
void *returnValueType;
POM_is_tag_valid( instance , &tagValid);
ifail = ORIGIN_select_counter(TeZhengMa,start_num);
TEST_ERROR(ifail)
ifail = load_current_number(TeZhengMa,&number);
printf("counter number = %d\n",number);
if (!attr_ok)
{
ifail = get_next_id_attribute();
TEST_ERROR(ifail)
}
//sprintf(item_number,"%s%d",TeZhengMa,number+1);
*sNum = (char *)MEM_alloc(sizeof(char)*100);
/* for( i=1;i<CYCLE_TIMES;i++) //zjd
*/
i=0;
do
{
i++;
ifail = generation_num(TeZhengMa,length,number+i,&new_num);
sprintf(*sNum,"%s",new_num);
printf("new_num = %s\n",new_num);
strcpy(counter_name,"%");
strcat(counter_name,new_num);
strcat(counter_name,"%");
printf("new_num of TeZhengMa=%s\n",counter_name);
ifail = EnqLikeNo(counter_name,&rows);
//if(new_num!=NULL)
// MEM_free(new_num);
/* if(rows==0) //zjd
{
break;
}*/
} while(rows!=0); //zjd
//ifail = generation_num(TeZhengMa,length,number+step,&new_num);
//printf("new_num = %s\n",new_num);
//strcpy(counter_name,"%");
//strcat(counter_name,new_num);
//strcat(counter_name,"%");
//printf("new_num of TeZhengMa=%s\n",counter_name);
//ifail = EnqLikeNo(counter_name,&rows);
//MEM_free(new_num);
//printf("rows = %d\n",rows);
if(is_new||start_num>number)
{
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;
}
/**
* @}
*/

@ -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 <stdio.h>
//#include <iostream>
//#include <windows.h>
//#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<string> &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<string> &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());}

@ -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 <string>
#include <vector>
using namespace std;
//extern string loginUser;
//extern string loginPassword;
string TrimString( string strArg );
void Split( string strArg, char spliter, vector<string> &ans );
void Split( string strArg, string spliter, vector<string> &ans );
void RemoveLiner( string &in, string &out );
//string ws2s(wstring& inputws);
//wstring s2ws(const string& s);
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>D:\source\锡压\xy2\xy2\x64\Release\xy2.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

Binary file not shown.

Binary file not shown.

@ -0,0 +1,139 @@
 common_itk_util.cpp
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: “Teamcenter::RootObject::m_typeName”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: “Teamcenter::RootObject::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: “Teamcenter::OperationInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::OperationInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: “Teamcenter::BulkInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::BulkInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: “Teamcenter::BulkData::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::BulkData”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: “Teamcenter::DeepCopyData::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::DeepCopyData”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: “Teamcenter::CreateInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::CreateInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: “Teamcenter::SaveAsInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::SaveAsInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: “Teamcenter::BusinessObject::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::BusinessObject”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\extensionframework\OperationDispatcher.hxx(442,37): warning C4251: “Teamcenter::OperationDispatcher::m_boName”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::OperationDispatcher”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: “Teamcenter::POM_object::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::POM_object”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\tccore\imantype.hxx(225,25): warning C4251: “Teamcenter::ImanType::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::ImanType”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
epm_auto_signoff_dataset.cpp
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(85,24): warning C4101: “root_template”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(572,9): warning C4101: “iCnt”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(573,22): warning C4101: “pTempStr”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(573,9): warning C4101: “user_lib_env”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(658,9): warning C4101: “iCnt”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(659,22): warning C4101: “pTempStr”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(659,9): warning C4101: “user_lib_env”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(752,9): warning C4101: “iCnt”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(753,22): warning C4101: “pTempStr”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(753,9): warning C4101: “user_lib_env”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1084,60): warning C4267: “参数”: 从“size_t”转换到“int”可能丢失数据
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1292,9): warning C4101: “m_lpszDefaultDir”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1334,21): warning C4101: “description”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1378,12): warning C4101: “local_path”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1411,15): warning C4101: “iCnt”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1412,28): warning C4101: “pTempStr”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1476,20): warning C4101: “new_file_descriptor”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\epm_auto_signoff_dataset.cpp(1412,15): warning C4101: “user_lib_env”: 未引用的局部变量
jy_create_material_code.cpp
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: “Teamcenter::RootObject::m_typeName”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: “Teamcenter::RootObject::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: “Teamcenter::OperationInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::OperationInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: “Teamcenter::BulkInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::BulkInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: “Teamcenter::BulkData::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::BulkData”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: “Teamcenter::DeepCopyData::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::DeepCopyData”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: “Teamcenter::CreateInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::CreateInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: “Teamcenter::SaveAsInput::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::SaveAsInput”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: “Teamcenter::BusinessObject::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::BusinessObject”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\extensionframework\OperationDispatcher.hxx(442,37): warning C4251: “Teamcenter::OperationDispatcher::m_boName”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::OperationDispatcher”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: “Teamcenter::POM_object::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::POM_object”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\WorkEnvironment\tc14ITK\include_cpp\tccore\imantype.hxx(225,25): warning C4251: “Teamcenter::ImanType::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“Teamcenter::ImanType”的客户端使用
C:\VS2019\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
D:\source\锡压\xy2\xy2\xy2\jy_create_material_code.cpp(420,9): warning C4477: “printf”: 格式字符串“%d”需要类型“int”的参数但可变参数 1 拥有了类型“unsigned __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: “printf”: 格式字符串“%d”需要类型“int”的参数但可变参数 1 拥有了类型“unsigned __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: “sprintf”: 没有为格式字符串传递足够的参数
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: “sprintf”: 格式字符串“%d”需要类型“int”的参数但可变参数 1 拥有了类型“unsigned __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: “protection”: 未引用的局部变量
main_lib.cpp
D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(804,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(5422,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
register_handler_methods.cpp
D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(804,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
D:\WorkEnvironment\tc14ITK\include\pom\pom\pom.h(5422,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(19,9): warning C4101: “now”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(18,58): warning C4101: “temp2”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(18,23): warning C4101: “expire_date”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(18,7): warning C4101: “date_buf”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(20,15): warning C4101: “p”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(18,36): warning C4101: “env”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\register_handler_methods.cpp(18,46): warning C4101: “temp1”: 未引用的局部变量
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: “printf”: 格式字符串“%d”需要类型“int”的参数但可变参数 1 拥有了类型“size_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: “failed_instances”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(346,17): warning C4101: “n_failtures”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(354,21): warning C4101: “j”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(354,18): warning C4101: “i”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(350,4): warning C4101: “instances”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(346,6): warning C4101: “n_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: “returnValueType”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(399,7): warning C4101: “rtn”: 未引用的局部变量
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: “returnValueType”: 未引用的局部变量
D:\source\锡压\xy2\xy2\xy2\service_part_no.cpp(479,7): warning C4101: “rtn”: 未引用的局部变量
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: “sprintf”: 格式字符串“%d”需要类型“int”的参数但可变参数 1 拥有了类型“unsigned __int64”
D:\source\锡压\xy2\xy2\xy2\xy_create_material_code.cpp(476,17): message : 请考虑在格式字符串中使用“%zd”
正在生成代码
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

Binary file not shown.

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

Binary file not shown.

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

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="common_itk_util.h" />
<ClInclude Include="error_handling.h" />
<ClInclude Include="itk_service_common.h" />
<ClInclude Include="register_handler_head.h" />
<ClInclude Include="register_handler_methods.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="string_helper.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="common_itk_util.cpp" />
<ClCompile Include="epm_auto_signoff_dataset.cpp" />
<ClCompile Include="jy_create_material_code.cpp" />
<ClCompile Include="main_lib.cpp" />
<ClCompile Include="register_handler_methods.cpp" />
<ClCompile Include="service_part_no.cpp" />
<ClCompile Include="string_helper.cpp" />
<ClCompile Include="xy_create_material_code.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="xy2.rc" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{ea48841c-4b5f-4555-b8f9-4e2ce1ed35ef}</ProjectGuid>
<RootNamespace>xy2</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<AdditionalIncludeDirectories>D:\WorkEnvironment\tc14ITK\include;D:\WorkEnvironment\tc14ITK\include_cpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>D:\WorkEnvironment\tc14ITK\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>D:\WorkEnvironment\tc14ITK\lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="common">
<UniqueIdentifier>{1c86beb0-ba33-4f2f-8c71-74ecb379da02}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="register_handler_methods.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="common_itk_util.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="error_handling.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="string_helper.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="itk_service_common.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="register_handler_head.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main_lib.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="register_handler_methods.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="epm_auto_signoff_dataset.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="jy_create_material_code.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="xy_create_material_code.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="common_itk_util.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="string_helper.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="service_part_no.cpp">
<Filter>common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="xy2.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

@ -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 <tccore/item.h>
#include <tccore/grmtype.h>
#include <tccore/grm.h>
#include <sa/am.h>
#include <tccore/aom.h>
#include <tccore/aom_prop.h>
#include <property/prop_errors.h>
#include <lov/lov_errors.h>
#include <lov/lov.h>
#include <tccore/tctype.h>
#include <res/res_itk.h>
/**
* @headerfile standard c & cpp header files
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <string>
#include <vector>
#include <map>
#include <fstream>
//#include <iostream>
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; li<n_values; li++)
{
if (strcmp(lov_values[li], prop_value) == 0)
{
lov_index = li;
find_prop_value = TRUE;
break;
}
}
MEM_free(lov_values);
if (find_prop_value)
{
LOV_usage_t usage;
char **desc_strings = NULL;
logical *is_null = NULL;
logical *is_empty = NULL;
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)
{
prop_desc.assign(desc_strings[lov_index]);
}
MEM_free(desc_strings);
MEM_free(is_null);
MEM_free(is_empty);
return ITK_ok;
}
}
else
{
int n_listOfFilters = 0, *listOfFiltersIndexes = NULL;
tag_t *listOfFilters = NULL;
ITKCALL( LOV_ask_value_filters( lov_tag, &n_listOfFilters, &listOfFiltersIndexes, &listOfFilters ) );
if (n_listOfFilters>0)
{
for (int li=0; li<n_listOfFilters; li++)
{
if (prop_desc.size()==0)
{
int new_filter_level = filter_level + 1;
ifail = CycleLovFilter( listOfFilters[li], prop_value, lov_order, new_filter_level, prop_desc );
}
else
break;
}
MEM_free( listOfFiltersIndexes );
MEM_free( listOfFilters );
}
}
}
return ifail;
}
static int FindPropLovDesc( tag_t object, const char *prop_name, PROP_value_type_t prop_type, string &prop_value )
{
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则不处理
{
int lov_order = 0;
char* object_type = NULL;
ITKCALL( WSOM_ask_object_type2( object, &object_type ) );
ITKCALL( LOV_ask_attached_dependency_order( object_type, prop_name, &lov_order ) );
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 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<string,string> item_types_map;
map<string,string>::iterator item_types_map_iter = item_types_map.begin();
vector<string> 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<num_of_arguments; i++)
{
ITKCALL( ITK_ask_argument_named_value( TC_next_argument( msg.arguments ), &flag, &value ) );
printf( "value = %s\n", value );
if ( strcmp( flag, "type" ) == 0 && value != NULL )
{
vector<string> ans;
Split( value, ',', ans );
for (size_t j=0; j<ans.size(); j++)
{
printf("here\n");
item_types_map.insert(make_pair(ans[j],ans[j]));
}
}
//else if ( strcmp( flag, "required_props" ) == 0 && value != NULL )
//{
// vector<string> ans;
// Split( value, ',', ans ); printf( "ans size = %d\n", ans.size() );
// for (size_t j=0; j<ans.size(); j++)
// {
// required_props_vec.push_back(ans[j]);
// }
//}
//else if ( strcmp( flag, "sid_leng" ) == 0 && value != NULL )
//{
// sid_leng = atoi(value);
// max_sid = (int)(pow( 10.0, sid_leng )) - 1;
//}
else if ( strcmp( flag, "target_prop" ) == 0 && value != NULL )
{
strcpy( target_prop, value );
} //check debug indicator
else if ( strcmp( flag, "target_value" ) == 0 && value != NULL )
{
strcpy( target_value, value );
} //check debug indicator
else if( strcmp( flag, "debug" ) == 0 && value != NULL )
{
if( strcmp( value, "true" ) == 0 )
is_debug = TRUE;
}
MEM_free( flag );
MEM_free( value );
}
//STEP 1:
//check handler arguments
printf("11111111\n");
if (item_types_map.size()==0)
{
printf( ("type argument is not specified, please check!\n") );
printf("type argument is not specified, please check!\n");
return EPM_missing_req_arg;
}
//else if ( required_props_vec.size()==0)
//{
// LOG_ECHO( ("required_props argument is not specified, please check!\n") );
// return EPM_missing_req_arg;
//}
//else if ( sid_leng==0 )
//{
// LOG_ECHO( ("sid_leng argument is not valid, please check!\n") );
// return EPM_missing_req_arg;
//}
else if (strlen(target_prop)==0 )
{
printf( ("target_prop argument is not valid, please check!\n") );
printf("target_prop is not specified, please check!\n");
return EPM_missing_req_arg;
}
//logical prop_not_defined = FALSE;
//logical lov_has_no_value = FALSE;
//item_types_map_iter = item_types_map.begin();
//for (; item_types_map_iter!=item_types_map.end(); item_types_map_iter++)
//{
// tag_t item_type = NULLTAG;
// char item_type_class[TCTYPE_class_name_size_c+1] = "";
// ITKCALL( TCTYPE_find_type( item_types_map_iter->first.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<tag_t> reference_revs_vec;
for (int ri=0; ri<reference_count; ri++)
{
printf("22222222\n");
tag_t class_id = NULLTAG;
ITKCALL( POM_class_of_instance( reference_list[ri], &class_id ) );
if ( class_id != NULLTAG )
{
char *class_name = NULL;
ITKCALL( POM_name_of_class( class_id, &class_name ) );
//TC8==================
//if ( class_name && *class_name && strcmp( class_name, "ItemRevision" ) == 0 )
if ( class_name && *class_name && strstr( class_name, "XY" ) != NULL )
{
tag_t item_tag = NULLTAG;
ITKCALL( ITEM_ask_item_of_rev( reference_list[ri], &item_tag ) );
char* item_type = NULL;
ITKCALL( ITEM_ask_type2( item_tag, &item_type ) );
if (item_types_map.find(item_type)!=item_types_map.end())
{
printf("33333333\n");
reference_revs_vec.push_back(reference_list[ri]);
}
}
MEM_free(class_name);
}
}
if (is_debug)
{
sprintf( buf, "Total %d objects will be processed\n", reference_revs_vec.size() );
printf( (buf) );
}
printf("444444444\n");
//处理所有的版本
for (int vi=0; vi<(int)reference_revs_vec.size(); vi++)
{
tag_t one_rev = reference_revs_vec[vi];
int form_count = 0;
tag_t *form_list = NULL, master_form = NULLTAG;
ITKCALL( GRM_list_secondary_objects_only( one_rev, master_form_rel_type, &form_count, &form_list ) );
master_form = form_list[0];
MEM_free(form_list);
//检查target_prop是否有值
//printf("55555555\n");
//logical is_null_empty = FALSE;
//ITKCALL( AOM_is_null_empty( master_form, target_prop, TRUE, &is_null_empty ) );
//if (!is_null_empty)
//{
// sprintf( "target prop %s had value already!\n", target_prop );
// LOG_ECHO( (buf) );
// continue;
//}
printf("6666666\n");
////检查JyErpNoSyncAppEPR编码申请是否为“申请”
//char *apply_value = NULL;
//ITKCALL( AOM_ask_value_string( master_form, "JyErpNoSyncApp", &apply_value ) );
//if ( apply_value && *apply_value && strcmp( apply_value, "不申请" ) == 0 )
//{
// MEM_free(apply_value);
// continue;
//}
//MEM_free(apply_value);
map<string,PROP_value_type_t> prop_type_map;
map<string,PROP_value_type_t>::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;
}
Loading…
Cancel
Save