版本文件签名,升版清空域(有问题)

main
zouxk 6 years ago
parent db5df65f49
commit 2bfc5f3f22

@ -0,0 +1,12 @@
[*]
# ReSharper properties
resharper_member_initializer_list_style=on_single_line
resharper_new_line_before_catch=false
resharper_new_line_before_else=false
resharper_new_line_before_while=false
resharper_simple_case_statement_style=line_break
resharper_simple_embedded_statement_style=line_break
resharper_wrap_after_expression_lbrace=false
resharper_wrap_before_expression_rbrace=false

@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "8.1",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}

Binary file not shown.

@ -129,7 +129,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>C:\work\include12_1;C:\work\include_cpp12_1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>C:\Java\jdk1.8.0_231\include\win32;C:\Java\jdk1.8.0_231\include;C:\work\include11;C:\work\include_cpp11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
@ -139,7 +139,7 @@
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<AdditionalDependencies>C:\work\lib12_1\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>C:\work\lib11\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<OutputFile>$(OutDir)\bs.dll</OutputFile>
<AdditionalOptions>/FORCE %(AdditionalOptions)</AdditionalOptions>
@ -159,11 +159,13 @@
<ClCompile Include="bs_signoff.cxx" />
<ClCompile Include="epm_register_handler.cxx" />
<ClCompile Include="bs_custom_main.cxx" />
<ClCompile Include="jd_clear_field.cpp" />
<ClCompile Include="jd_signoff.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="epm_handler_common.h" />
<ClInclude Include="epm_register_handler.h" />
<ClInclude Include="jd_clear_field.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

@ -52,6 +52,9 @@
<ClCompile Include="jd_signoff.cpp">
<Filter>epm-handler</Filter>
</ClCompile>
<ClCompile Include="jd_clear_field.cpp">
<Filter>epm-handler</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="epm_register_handler.h">
@ -60,5 +63,8 @@
<ClInclude Include="epm_handler_common.h">
<Filter>epm-handler</Filter>
</ClInclude>
<ClInclude Include="jd_clear_field.h">
<Filter>epm-handler</Filter>
</ClInclude>
</ItemGroup>
</Project>

@ -27,6 +27,7 @@
#include <server_exits/user_server_exits.h>
#include "epm_register_handler.h"
#include "epm_handler_common.h"
#include "jd_clear_field.h"
#ifdef __cplusplus
@ -53,6 +54,7 @@ extern "C" {
"USER_gs_shell_init_module",
(CUSTOM_EXIT_ftn_t)CUST_init_module);
Register_revise_msg();
return ifail;
}

@ -0,0 +1,522 @@
#include "jd_clear_field.h"
#include <string>
#include <vector>
#include <map>
#include <fstream>
#include <epm/epm.h>
#include <epm/epm_toolkit_tc_utils.h>
#include <ict/ict_userservice.h>
#include <tccore/item.h>
#include <ae/ae.h>
#include <tc/folder.h>
#include <tccore/aom.h>
#include <sa/sa.h>
#include <tccore/aom_prop.h>
#include <property/prop_errors.h>
#include <tccore/workspaceobject.h>
#include <tc/preferences.h>
#include <tccore/imantype.h>
#include <tccore//grm.h>
#include <tccore/grmtype.h>
#include <sa/am.h>
#include <cfm/cfm.h>
#include <bom/bom.h>
#include <iostream>
#include <tccore/uom.h>
#include <ps/ps.h>
#include <epm/signoff.h>
#include <fclasses/tc_date.h>
#include <sa/tcfile_cache.h>
#include <ics\ics2.h>
#include "sstream"
#include "libxl.h"
#include "atlstr.h"
#include <tc\tc_macros.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <property\propdesc.h>
#include <epm\epm.h>
#include <epm\epm_toolkit_tc_utils.h>
#include <tccore\item.h>
#include <tccore\grmtype.h>
#include <tccore\grm.h>
#include <tccore\imantype.h>
#include <sa\am.h>
#include <sa\sa.h>
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <property\prop_errors.h>
#include <tccore\workspaceobject.h>
#include <qry\qry.h>
#include <bom\bom_attr.h>
#include <bom\bom.h>
#include <epm\signoff.h>
#include <pom\pom\pom.h>
#include <pom\pom\pom_errors.h>
#include <fclasses\tc_date.h>
#include <epm\cr.h>
#include <cfm\cfm.h>
#include <sa\am.h>
#include "tc/envelope.h"
#include <stdio.h>
#include "ae/dataset.h"
#include <ctype.h>
#include <string.h>
#include <string>
#include <iostream>
#include <iterator>
#include <map>
#include <vector>
#include "ce/ce.h"
#include <time.h>
#include <windows.h>
#include <iostream>
#include <sql.h>
#include <sqlext.h>
#include "string"
#include "sstream"
#include <sa/tcfile.h>
#include <tccore/aom.h>
#include <sa/tcfile_cache.h>
#include <form/form.h>
#include "ctime"
#include "tchar.h"
#include "jni.h"
#ifdef WIN32
#include <io.h>
#include <direct.h>
#else
#include <unistd.h>
#include <sys/stat.h>
#endif
#include <stdint.h>
#include <string>
#define MAX_PATH_LEN 256
#ifdef WIN32
#define ACCESS(fileName,accessMode) _access(fileName,accessMode)
#define MKDIR(path) _mkdir(path)
#else
#define ACCESS(fileName,accessMode) access(fileName,accessMode)
#define MKDIR(path) mkdir(path,S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
#endif
//#include <iostream>
using namespace std;
using namespace libxl;
#ifdef __cplusplus
extern "C" int POM_AM__set_application_bypass(logical bypass);
extern "C" {
#endif
int32_t createDirectory(const std::string &directoryPath) {
uint32_t dirPathLen = directoryPath.length();
if (dirPathLen > MAX_PATH_LEN) {
return -1;
}
char tmpDirPath[MAX_PATH_LEN] = { 0 };
for (uint32_t i = 0; i < dirPathLen; ++i) {
tmpDirPath[i] = directoryPath[i];
if (tmpDirPath[i] == '\\' || tmpDirPath[i] == '/') {
if (ACCESS(tmpDirPath, 0) != 0) {
int32_t ret = MKDIR(tmpDirPath);
if (ret != 0) {
return ret;
}
}
}
}
return 0;
}
static void replace_dataset_named_reference(tag_t dataset_tag, tag_t old_file,
const char *new_file_path, char *ref_name) {
IMF_file_data_p_t file_data;
int index = 0;
char *name;
IMF_get_file_access(old_file, 0, &file_data);
tag_t new_file_tag = NULLTAG;
AOM_lock(old_file);
IMF_ask_original_file_name2(old_file, &name);
IMF_replace_file_and_get_new_tag(old_file, new_file_path,
FALSE, &new_file_tag);
AOM_lock(dataset_tag);
AE_replace_dataset_named_ref2(dataset_tag, old_file, ref_name,
AE_PART_OF, new_file_tag);
AE_save_myself(dataset_tag);
IMF_set_original_file_name2(new_file_tag, name);
AOM_unlock(dataset_tag);
IMF_release_file_access(&file_data);
}
bool isTypeOf(tag_t objtag, const char * type_name) {
tag_t type = NULLTAG;
TCTYPE_ask_object_type(objtag, &type);
tag_t item_type = NULLTAG;
TCTYPE_find_type(type_name, "", &item_type);
bool is_type = false;
if (item_type != NULLTAG) {
logical isok = FALSE;
TCTYPE_is_type_of(type, item_type, &isok);
if (isok) {
is_type = true;
}
}
return is_type;
}
string GBKToUTF8(const char* strGBK) {
int len = MultiByteToWideChar(CP_ACP, 0, strGBK, -1, NULL, 0);
wchar_t* wstr = new wchar_t[len + 1];
memset(wstr, 0, len + 1);
MultiByteToWideChar(CP_ACP, 0, strGBK, -1, wstr, len);
len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
char* str = new char[len + 1];
memset(str, 0, len + 1);
WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL);
string strTemp = str;
if (wstr) delete[] wstr;
if (str) delete[] str;
return strTemp;
}
/*
-path
-name
-step : 4950515253
*/
static int sign(JNIEnv* env, jclass class_Test, const char* path, char* name, int step) {
printf("signin\n");
jmethodID methodId_main = env->GetStaticMethodID(class_Test, "sign", "(Ljava/lang/String;Ljava/lang/String;I)I");
if (methodId_main == NULL) {
printf("error\n");
return 0;
}
string path1 = GBKToUTF8(path);
string name1 = GBKToUTF8(name);
jstring jpath = env->NewStringUTF(path1.c_str());
jstring jname = env->NewStringUTF(name1.c_str());
jint jstep = (jint)step;
printf("path:%s,name%s,step%d\n", path1.c_str(), name1.c_str(), step);
jint result = 0;
result = env->CallStaticIntMethod(class_Test, methodId_main, jpath, jname, jstep);
int res = result;
printf("result:%d\n", res);
printf("signout\n");
return res;
}
void add_path(JNIEnv* env, const std::string& path) {
const std::string urlPath = "file:/" + path;
jclass classLoaderCls = env->FindClass("java/lang/ClassLoader");
printf("111\n");
jmethodID getSystemClassLoaderMethod = env->GetStaticMethodID(classLoaderCls, "getSystemClassLoader", "()Ljava/lang/ClassLoader;");
jobject classLoaderInstance = env->CallStaticObjectMethod(classLoaderCls, getSystemClassLoaderMethod);
jclass urlClassLoaderCls = env->FindClass("java/net/URLClassLoader");
jmethodID addUrlMethod = env->GetMethodID(urlClassLoaderCls, "addURL", "(Ljava/net/URL;)V");
jclass urlCls = env->FindClass("java/net/URL");
jmethodID urlConstructor = env->GetMethodID(urlCls, "<init>", "(Ljava/lang/String;)V");
jobject urlInstance = env->NewObject(urlCls, urlConstructor, env->NewStringUTF(urlPath.c_str()));
env->CallVoidMethod(classLoaderInstance, addUrlMethod, urlInstance);
std::cout << "Added " << urlPath << " to the classpath." << std::endl;
}
int JD_Revise_clear(METHOD_message_t* msg, va_list args) {
printf("升版执行\n");
//获取数据集
char *temp_path, *attach_type;
int n_attachs;
tag_t ref_obj, excelx_tag, excel_tag, wordx_tag, word_tag, type_tag, word_ref, excel_ref, *dataset;
ITEM_attached_object_t *rev_attachments;
AE_reference_type_t ae_ref;
TCTYPE_find_type("MSExcelX", "Dataset", &excelx_tag);
TCTYPE_find_type("MSExcel", "Dataset", &excel_tag);
TCTYPE_find_type("MSWord", "Dataset", &word_tag);
TCTYPE_find_type("MSWordX", "Dataset", &wordx_tag);
temp_path = getenv("temp");
printf("temp_path:%s\n", temp_path);
//创建tc_export目录
stringstream dir;
dir << temp_path;
dir << "\\tc_export\\";
createDirectory(dir.str());
printf("dir:%s\n", dir.str().c_str());
//获取时间
//time_t t;
//time(&t);
//tm* time = localtime(&t);
stringstream date;
//date << time->tm_year + 1900 << "-";
//date << time->tm_mon + 1 << "-";
//date << time->tm_mday << "-";
//date << time->tm_hour << "-";
//date << time->tm_min << "-";
//date << time->tm_sec;
date << "2";
printf("datetime:%s\n",date.str().c_str());
POM_AM__set_application_bypass(true);
//申请虚拟机
wstringstream wss;
wss << getenv("JRE_HOME") << "\\bin\\server\\jvm.dll";
printf("wxs:%s\n",wss.str().c_str());
JavaVMInitArgs vmArgs;
const int OPTION_COUNT = 1;
vmArgs.nOptions = OPTION_COUNT;
JavaVMOption options[OPTION_COUNT] = { 0 };
options[0].optionString = "-Xmx1024m";
vmArgs.options = options;
vmArgs.version = JNI_VERSION_1_8;
vmArgs.ignoreUnrecognized = JNI_TRUE;
printf("before load dll\n");
HMODULE hModule = LoadLibrary(wss.str().c_str());
if (hModule == NULL) {
printf("error load dll");
return -1;
}
printf("after load dll\n");
typedef jint(JNICALL *CreateJavaVMFuncPtr)(JavaVM **pvm, void **penv, void *args);
CreateJavaVMFuncPtr CreateJavaVM = (CreateJavaVMFuncPtr)GetProcAddress(hModule, "JNI_CreateJavaVM");
typedef jint(JNICALL * GetCreatedJavaVMs)(JavaVM**, jsize, jsize*);
GetCreatedJavaVMs jni_GetCreatedJavaVMs;
jni_GetCreatedJavaVMs = (GetCreatedJavaVMs)GetProcAddress(GetModuleHandle(
TEXT("jvm.dll")), "JNI_GetCreatedJavaVMs");
JavaVM *jvm = nullptr, *jvms;
JNIEnv *env = nullptr;
jsize size = 0;
jni_GetCreatedJavaVMs(&jvms, 0, &size);
printf("before load jvm\n");
if (size) {
JavaVM** buffer = new JavaVM*[size];
jni_GetCreatedJavaVMs(buffer, size, &size);
buffer[0]->GetEnv((void**)&env, JNI_VERSION_1_8);
jint result = buffer[0]->AttachCurrentThread((void**)&env, NULL);
} else {
jint res = (*CreateJavaVM)(&jvm, (void**)&env, &vmArgs);
if (res < 0) {
printf("error load jvm");
return -1;
}
}
printf("after load jvm\n");
add_path(env, "D:\\Siemens\\Teamcenter11\\bin\\tc_extra_jar\\sign2fileRunnable.jar");
//add_path(env, "D:\\app\\Siemens\\Teamcenter12\\bin\\tc_extra_jar\\sign2fileRunnable.jar");
printf("add path\n");
jclass class_Test;
int file_type = -1;
int ifail = ITK_ok, objects_count;
tag_t new_rev = va_arg(args, tag_t), *objects;
char* operation = va_arg(args, char*);
if (strcmp(operation, "Revise") == 0 || strcmp(operation, "SaveAs") == 0) {
//todo怎么判断需要操作的类型?
if (isTypeOf(new_rev, "ItemRevision")) {
ITKCALL(AOM_ask_value_tags(new_rev, "IMAN_master_form_rev", &objects_count, &objects));
//表单签名
for (auto iii = 0; iii < objects_count; iii++) {
AOM_lock(objects[iii]);
AOM_set_value_string(objects[iii], "jd2_bz", "");
AOM_set_value_string(objects[iii], "jd2_bzrq", "");
AOM_set_value_string(objects[iii], "jd2_jd", "");
AOM_set_value_string(objects[iii], "jd2_jdrq", "");
AOM_set_value_string(objects[iii], "jd2_sh", "");
AOM_set_value_string(objects[iii], "jd2_shrq", "");
AOM_set_value_string(objects[iii], "jd2_hq", "");
AOM_set_value_string(objects[iii], "jd2_hqrq", "");
AOM_set_value_string(objects[iii], "jd2_pz", "");
AOM_set_value_string(objects[iii], "jd2_pzrq", "");
ITKCALL(AOM_save(objects[iii]));
AOM_unlock(objects[iii]);
}
MEM_free(objects);
printf("startSign\n");
ITKCALL(AOM_ask_value_tags(new_rev, "IMAN_specification", &n_attachs, &dataset));
for (int i = 0;i < n_attachs;i++) {
stringstream ss;
ss << dir.str().c_str();
printf(ss.str().c_str());
ITKCALL(TCTYPE_ask_object_type(dataset[i], &type_tag));
if (type_tag == wordx_tag || type_tag == word_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "word", &ae_ref, &word_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(word_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "word", ss.str().c_str()));
file_type = 0;
} else if (type_tag == excel_tag || type_tag == excelx_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "excel", &ae_ref, &excel_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(excel_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "excel", ss.str().c_str()));
file_type = 1;
}
printf("file_type:%d\n", file_type);
if (file_type == 0) {
class_Test = env->FindClass("sign2file/SignToWord");
int res = sign(env, class_Test, ss.str().c_str(), "", 54);
if (res) {
replace_dataset_named_reference(dataset[i], word_ref, ss.str().c_str(), "word");
}
} else if (file_type == 1) {
class_Test = env->FindClass("sign2file/SignToExcel");
int res = sign(env, class_Test, ss.str().c_str(), "", 54);
if (res) {
replace_dataset_named_reference(dataset[i], excel_ref, ss.str().c_str(), "excel");
}
}
file_type = -1;
}
MEM_free(dataset);
AOM_ask_value_tags(new_rev, "TC_Attaches", &n_attachs, &dataset);
for (int i = 0;i < n_attachs;i++) {
stringstream ss;
ss << dir.str().c_str();
ITKCALL(TCTYPE_ask_object_type(dataset[i], &type_tag));
if (type_tag == wordx_tag || type_tag == word_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "word", &ae_ref, &word_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(word_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "word", ss.str().c_str()));
file_type = 0;
} else if (type_tag == excel_tag || type_tag == excelx_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "excel", &ae_ref, &excel_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(excel_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "excel", ss.str().c_str()));
file_type = 1;
}
printf("file_type:%d\n", file_type);
if (file_type == 0) {
class_Test = env->FindClass("sign2file/SignToWord");
int res = sign(env, class_Test, ss.str().c_str(), "", 54);
if (res) {
replace_dataset_named_reference(dataset[i], word_ref, ss.str().c_str(), "word");
}
} else if (file_type == 1) {
class_Test = env->FindClass("sign2file/SignToExcel");
int res = sign(env, class_Test, ss.str().c_str(), "", 54);
if (res) {
replace_dataset_named_reference(dataset[i], excel_ref, ss.str().c_str(), "excel");
}
}
file_type = -1;
}
MEM_free(dataset);
printf("endSign\n");
}
}
FreeLibrary(hModule);
POM_AM__set_application_bypass(false);
return ifail;
}
extern int Register_revise_msg(void) {
int status = ITK_ok;
char *err_string, *err_function;
int err_line = -1;
printf("JD_Revise_clear函数\n");
METHOD_id_t mth_tag;
ITKCALL(status = METHOD_find_method("ItemRevision", ITEM_deep_copy_msg, &mth_tag));
if (mth_tag.id != 0) {
ITKCALL(METHOD_add_action(mth_tag, METHOD_post_action_type, JD_Revise_clear, NULL));
printf("JD_Revise_clear注册成功");
}
return status;
}
#ifdef __cplusplus
}
#endif
#include <stdarg.h>
#include <base_utils\Mem.h>
#include <tccore\grm.h>
#include <tccore\grmtype.h>
#include <tc\iman.h>
#include <user_exits\user_exits.h>
#include <tccore\method.h>
#include <property\prop.h>
#include <tccore\aom_prop.h>
#include <property\prop_msg.h>
#include <tccore\imantype.h>
#include <property\prop_errors.h>
#include <tccore\item.h>
#include <lov\lov.h>
#include <sa\sa.h>
#include <tc\emh.h>
#include <res\reservation.h>
#include <tccore\workspaceobject.h>
#include <tc\wsouif_errors.h>
#include <tccore\aom.h>
#include <form\form.h>
#include <bom\bom.h>
#include <epm\cr.h>
#include <epm\releasestatus.h>
/**
* @headerfile standard c & cpp header files
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <fstream>
#include <iostream>
using namespace std;
/**
* @headerfile user's header files
*/

@ -0,0 +1,33 @@
#ifndef W2_CLEAR_FORM_PROPVALUE
#define W2_CLEAR_FORM_PROPVALUE
#include <sa\am.h>
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <tccore\item.h>
#include <tccore\grm.h>
#include <tc\preferences.h>
#include<tc\tc_macros.h>
#include <user_exits\user_exits.h>
#include <tccore\method.h>
#include <tccore\tctype.h>
#include <tccore\item_msg.h>
#include <tccore\tc_msg.h>
#include <tccore\grmtype.h>
#include <tccore\grm.h>
#include <tccore\imantype.h>
#include <itk\bmf.h>
#include <bmf\libuserext_exports.h>
#ifdef __cplusplus
extern "C" {
#endif
extern USER_EXT_DLL_API int HXC_Revise_clear_form( METHOD_message_t* msg, va_list args );
extern int Register_revise_msg(void);
#ifdef __cplusplus
}
#endif
#include <bmf\libuserext_undef.h>
#endif

@ -1,4 +1,4 @@
#include "epm_handler_common.h"
#include "epm_handler_common.h"
#include <tc\tc_macros.h>
#include <tc\emh.h>
#include <tc\preferences.h>
@ -49,47 +49,200 @@
#include <form/form.h>
#include "ctime"
#include "tchar.h"
#include "jni.h"
#ifdef WIN32
#include <io.h>
#include <direct.h>
#else
#include <unistd.h>
#include <sys/stat.h>
#endif
#include <stdint.h>
#include <string>
#define MAX_PATH_LEN 256
#ifdef WIN32
#define ACCESS(fileName,accessMode) _access(fileName,accessMode)
#define MKDIR(path) _mkdir(path)
#else
#define ACCESS(fileName,accessMode) access(fileName,accessMode)
#define MKDIR(path) mkdir(path,S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
#endif
using namespace std;
extern "C" int POM_AM__set_application_bypass(logical bypass);
//吉德表单签名
int32_t createDirectory(const std::string &directoryPath) {
uint32_t dirPathLen = directoryPath.length();
if (dirPathLen > MAX_PATH_LEN) {
return -1;
}
char tmpDirPath[MAX_PATH_LEN] = { 0 };
for (uint32_t i = 0; i < dirPathLen; ++i) {
tmpDirPath[i] = directoryPath[i];
if (tmpDirPath[i] == '\\' || tmpDirPath[i] == '/') {
if (ACCESS(tmpDirPath, 0) != 0) {
int32_t ret = MKDIR(tmpDirPath);
if (ret != 0) {
return ret;
}
}
}
}
return 0;
}
static void replace_dataset_named_reference(tag_t dataset_tag, tag_t old_file,
const char *new_file_path, char *ref_name) {
IMF_file_data_p_t file_data;
int index = 0;
char *name;
IMF_get_file_access(old_file, 0, &file_data);
tag_t new_file_tag = NULLTAG;
AOM_lock(old_file);
IMF_ask_original_file_name2(old_file, &name);
IMF_replace_file_and_get_new_tag(old_file, new_file_path,
FALSE, &new_file_tag);
AOM_lock(dataset_tag);
AE_replace_dataset_named_ref2(dataset_tag, old_file, ref_name,
AE_PART_OF, new_file_tag);
AE_save_myself(dataset_tag);
IMF_set_original_file_name2(new_file_tag, name);
AOM_unlock(dataset_tag);
IMF_release_file_access(&file_data);
}
bool isTypeOf(tag_t objtag, const char * type_name) {
tag_t type = NULLTAG;
TCTYPE_ask_object_type(objtag, &type);
tag_t item_type = NULLTAG;
TCTYPE_find_type(type_name, "", &item_type);
bool is_type = false;
if (item_type != NULLTAG) {
logical isok = FALSE;
TCTYPE_is_type_of(type, item_type, &isok);
if (isok) {
is_type = true;
}
}
return is_type;
}
string GBKToUTF8(const char* strGBK)
{
int len = MultiByteToWideChar(CP_ACP, 0, strGBK, -1, NULL, 0);
wchar_t* wstr = new wchar_t[len + 1];
memset(wstr, 0, len + 1);
MultiByteToWideChar(CP_ACP, 0, strGBK, -1, wstr, len);
len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
char* str = new char[len + 1];
memset(str, 0, len + 1);
WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL);
string strTemp = str;
if (wstr) delete[] wstr;
if (str) delete[] str;
return strTemp;
}
/*
-path
-name
-step : 4950515253
*/
static int sign(JNIEnv* env, jclass class_Test,const char* path, char* name, int step) {
printf("signin\n");
jmethodID methodId_main = env->GetStaticMethodID(class_Test, "sign", "(Ljava/lang/String;Ljava/lang/String;I)I");
if (methodId_main==NULL) {
printf("error\n");
return 0;
}
string path1 = GBKToUTF8(path);
string name1 = GBKToUTF8(name);
jstring jpath = env->NewStringUTF(path1.c_str());
jstring jname = env->NewStringUTF(name1.c_str());
jint jstep = (jint)step;
printf("path:%s,name%s,step%d\n", path1.c_str(), name1.c_str(),step);
jint result = 0;
result = env->CallStaticIntMethod(class_Test, methodId_main, jpath, jname, jstep);
int res = result;
printf("result:%d\n", res);
printf("signout\n");
return res;
}
void add_path(JNIEnv* env, const std::string& path)
{
const std::string urlPath = "file:/" + path;
jclass classLoaderCls = env->FindClass("java/lang/ClassLoader");
printf("111\n");
jmethodID getSystemClassLoaderMethod = env->GetStaticMethodID(classLoaderCls, "getSystemClassLoader", "()Ljava/lang/ClassLoader;");
jobject classLoaderInstance = env->CallStaticObjectMethod(classLoaderCls, getSystemClassLoaderMethod);
jclass urlClassLoaderCls = env->FindClass("java/net/URLClassLoader");
jmethodID addUrlMethod = env->GetMethodID(urlClassLoaderCls, "addURL", "(Ljava/net/URL;)V");
jclass urlCls = env->FindClass("java/net/URL");
jmethodID urlConstructor = env->GetMethodID(urlCls, "<init>", "(Ljava/lang/String;)V");
jobject urlInstance = env->NewObject(urlCls, urlConstructor, env->NewStringUTF(urlPath.c_str()));
env->CallVoidMethod(classLoaderInstance, addUrlMethod, urlInstance);
std::cout << "Added " << urlPath << " to the classpath." << std::endl;
}
//吉德表单签名
int jd_signoff(EPM_action_message_t msg) {
/*
-status:
12345
*/
const char bz = '1', jd = '2', sh = '3', hq = '4', pz = '5';
int ifail = ITK_ok, att_count, objects_count;
tag_t rootTask, *attachments, user_tag;
char *user_name, step;
ITEM_attached_object_t *objects;
const char bz = '1', jd = '2', sh = '3', hq = '4', pz = '5', bz_back = '0';
int ifail = ITK_ok, att_count, objects_count, step;
tag_t rootTask, *attachments, user_tag, *objects;
char *user_name;
logical verdict;
//获取时间
//获取时间
time_t t;
time(&t);
tm* time = localtime(&t);
stringstream date;
date << time->tm_year + 1900 << "-";
date << time->tm_mon + 1 << "-";
date << time->tm_mday;
date << time->tm_mday << "-";
date << time->tm_hour << "-";
date << time->tm_min << "-";
date << time->tm_sec;
//获取数据集
char *temp_path, *attach_type;
int n_attachs;
tag_t ref_obj, excelx_tag, excel_tag, wordx_tag, word_tag, type_tag, word_ref, excel_ref, *dataset;
ITEM_attached_object_t *rev_attachments;
AE_reference_type_t ae_ref;
TCTYPE_find_type("MSExcelX", "Dataset", &excelx_tag);
TCTYPE_find_type("MSExcel", "Dataset", &excel_tag);
TCTYPE_find_type("MSWord", "Dataset", &word_tag);
TCTYPE_find_type("MSWordX", "Dataset", &wordx_tag);
temp_path = getenv("temp");
POM_AM__set_application_bypass(true);
//获取当前用户
//获取当前用户
POM_get_user(&user_name, &user_tag);
//获取选中的目标对象
//获取选中的目标对象
TC_argument_list_t * arguments = msg.arguments;
int arg_cnt = TC_number_of_arguments(arguments), status = 0;
EPM_ask_root_task(msg.task, &rootTask);
EPM_ask_attachments(rootTask, EPM_target_attachment, &att_count, &attachments);
//获取流程中配置的handler属性
//获取流程中配置的handler属性
map<string, string> paras;
for (auto i = 0; i<arg_cnt; i++){
char *temp_key, *temp_val;
@ -98,48 +251,251 @@ int jd_signoff(EPM_action_message_t msg) {
}
step = paras["step"].c_str()[0];
printf("%d\n", step);
printf("%s\n", user_name);
printf("%s\n", date.str().c_str());
//创建tc_export目录
stringstream dir;
dir << temp_path;
dir << "\\tc_export\\";
createDirectory(dir.str());
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR)&lpMsgBuf,
0,
NULL
);
//申请虚拟机
//wstringstream wss;
//wss << getenv("JRE_HOME") << "\\bin\\server\\jvm.dll";
//JavaVMInitArgs vmArgs;
//vmArgs.version = JNI_VERSION_1_8;
//const int OPTION_COUNT = 2;
//vmArgs.nOptions = OPTION_COUNT;
//JavaVMOption options[OPTION_COUNT] = { 0 };
//options[0].optionString = "-Djava.class.path=D:\\Siemens\\Teamcenter11\\bin\\tc_extra_jar\\sign2fileRunnable.jar";
//options[1].optionString = "-Xmx1024m";
//vmArgs.options = options;
//vmArgs.ignoreUnrecognized = JNI_TRUE;
//printf("before load dll\n");
//HMODULE hModule = LoadLibrary(wss.str().c_str());
//if (hModule == NULL) {
// printf("error load dll");
// return -1;
//}
//printf("after load dll\n");
//typedef jint(JNICALL *CreateJavaVMFuncPtr)(JavaVM **pvm, void **penv, void *args);
//CreateJavaVMFuncPtr CreateJavaVM = (CreateJavaVMFuncPtr)GetProcAddress(hModule, "JNI_CreateJavaVM");
//JavaVM *jvm = nullptr;
//JNIEnv *env = nullptr;
//jint res = (*CreateJavaVM)(&jvm, (void**)&env, &vmArgs);
//if (res < 0) {
// printf("error load jvm");
// return -1;
//}
//printf("after load jvm\n");
for (auto ii = 0; ii < att_count; ii++) {
ITEM_list_rev_attachs_of_type(attachments[ii], ITEM_item_master_atth, &objects_count, &objects);
for (auto iii = 0; iii < objects_count; iii++) {
POM_modifiable(objects[iii].attachment, &verdict);
if (!verdict) {
AOM_refresh(objects[iii].attachment, TRUE);
wstringstream wss;
wss << getenv("JRE_HOME") << "\\bin\\server\\jvm.dll";
JavaVMInitArgs vmArgs;
const int OPTION_COUNT = 1;
vmArgs.nOptions = OPTION_COUNT;
JavaVMOption options[OPTION_COUNT] = { 0 };
options[0].optionString = "-Xmx1024m";
vmArgs.options = options;
vmArgs.version = JNI_VERSION_1_8;
vmArgs.ignoreUnrecognized = JNI_TRUE;
printf("before load dll\n");
HMODULE hModule = LoadLibrary(wss.str().c_str());
if (hModule == NULL){
printf("error load dll");
return -1;
}
printf("after load dll\n");
typedef jint(JNICALL *CreateJavaVMFuncPtr)(JavaVM **pvm, void **penv, void *args);
CreateJavaVMFuncPtr CreateJavaVM = (CreateJavaVMFuncPtr)GetProcAddress(hModule, "JNI_CreateJavaVM");
typedef jint(JNICALL * GetCreatedJavaVMs)(JavaVM**, jsize, jsize*);
GetCreatedJavaVMs jni_GetCreatedJavaVMs;
jni_GetCreatedJavaVMs = (GetCreatedJavaVMs)GetProcAddress(GetModuleHandle(
TEXT("jvm.dll")), "JNI_GetCreatedJavaVMs");
JavaVM *jvm = nullptr, *jvms;
JNIEnv *env = nullptr;
jsize size = 0;
jni_GetCreatedJavaVMs(&jvms, 0, &size);
printf("before load jvm\n");
if (size) {
JavaVM** buffer = new JavaVM*[size];
jni_GetCreatedJavaVMs(buffer, size, &size);
buffer[0]->GetEnv((void**)&env, JNI_VERSION_1_8);
jint result = buffer[0]->AttachCurrentThread((void**)&env, NULL);
} else {
jint res = (*CreateJavaVM)(&jvm, (void**)&env, &vmArgs);
if (res < 0){
printf("error load jvm");
return -1;
}
}
printf("after load jvm\n");
add_path(env, "D:\\Siemens\\Teamcenter11\\bin\\tc_extra_jar\\sign2fileRunnable.jar");
//add_path(env, "D:\\app\\Siemens\\Teamcenter12\\bin\\tc_extra_jar\\sign2fileRunnable.jar");
printf("add path\n");
jclass class_Test;
int file_type = -1;
printf("step:%d\n", step);
printf("user_name:%s\n", user_name);
printf("date:%s\n", date.str().c_str());
for (auto ii = 0; ii < att_count; ii++) {
if (isTypeOf(attachments[ii],"ItemRevision")) {
ITKCALL(AOM_ask_value_tags(attachments[ii], "IMAN_master_form_rev", &objects_count, &objects));
//表单签名
for (auto iii = 0; iii < objects_count; iii++) {
printf("step:%c\n",step);
AOM_lock(objects[iii]);
switch (step) {
case bz:
FORM_set_value(objects[iii].attachment, "jd2_bz", user_name);
FORM_set_value(objects[iii].attachment, "jd2_bzrq", date.str().c_str());
AOM_set_value_string(objects[iii], "jd2_bz", user_name);
AOM_set_value_string(objects[iii], "jd2_bzrq", date.str().c_str());
break;
case jd:
FORM_set_value(objects[iii].attachment, "jd2_jd", user_name);
FORM_set_value(objects[iii].attachment, "jd2_jdrq", date.str().c_str());
AOM_set_value_string(objects[iii], "jd2_jd", user_name);
AOM_set_value_string(objects[iii], "jd2_jdrq", date.str().c_str());
break;
case sh:
FORM_set_value(objects[iii].attachment, "jd2_sh", user_name);
FORM_set_value(objects[iii].attachment, "jd2_shrq", date.str().c_str());
AOM_set_value_string(objects[iii], "jd2_sh", user_name);
AOM_set_value_string(objects[iii], "jd2_shrq", date.str().c_str());
break;
case hq:
FORM_set_value(objects[iii].attachment, "jd2_hq", user_name);
FORM_set_value(objects[iii].attachment, "jd2_hqrq", date.str().c_str());
AOM_set_value_string(objects[iii], "jd2_hq", user_name);
AOM_set_value_string(objects[iii], "jd2_hqrq", date.str().c_str());
break;
case pz:
FORM_set_value(objects[iii].attachment, "jd2_pz", user_name);
FORM_set_value(objects[iii].attachment, "jd2_pzrq", date.str().c_str());
AOM_set_value_string(objects[iii], "jd2_pz", user_name);
AOM_set_value_string(objects[iii], "jd2_pzrq", date.str().c_str());
break;
case bz_back:
AOM_set_value_string(objects[iii], "jd2_jd", "");
AOM_set_value_string(objects[iii], "jd2_jdrq", "");
AOM_set_value_string(objects[iii], "jd2_sh", "");
AOM_set_value_string(objects[iii], "jd2_shrq", "");
AOM_set_value_string(objects[iii], "jd2_hq", "");
AOM_set_value_string(objects[iii], "jd2_hqrq", "");
AOM_set_value_string(objects[iii], "jd2_pz", "");
AOM_set_value_string(objects[iii], "jd2_pzrq", "");
break;
default:
printf("%s\n", "error");
}
AOM_save(objects[iii].attachment);
AOM_unlock(objects[iii].attachment);
AOM_unload(objects[iii].attachment);
ITKCALL(AOM_save(objects[iii]));
AOM_unlock(objects[iii]);
}
MEM_free(objects);
printf("startSign\n");
ITKCALL(AOM_ask_value_tags(attachments[ii], "IMAN_specification", &n_attachs, &dataset));
for (int i = 0;i < n_attachs;i++) {
stringstream ss;
ss << dir.str().c_str();
printf(ss.str().c_str());
ITKCALL(TCTYPE_ask_object_type(dataset[i], &type_tag));
if (type_tag == wordx_tag || type_tag == word_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "word", &ae_ref, &word_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(word_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "word", ss.str().c_str()));
file_type = 0;
} else if (type_tag == excel_tag || type_tag == excelx_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "excel", &ae_ref, &excel_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(excel_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "excel", ss.str().c_str()));
file_type = 1;
}
printf("file_type:%d\n", file_type);
if (file_type == 0) {
class_Test = env->FindClass("sign2file/SignToWord");
int res = sign(env, class_Test, ss.str().c_str(), user_name, step);
if (res) {
replace_dataset_named_reference(dataset[i], word_ref, ss.str().c_str(), "word");
}
} else if (file_type == 1) {
class_Test = env->FindClass("sign2file/SignToExcel");
int res = sign(env, class_Test, ss.str().c_str(), user_name, step);
if (res) {
replace_dataset_named_reference(dataset[i], excel_ref, ss.str().c_str(), "excel");
}
}
file_type = -1;
}
MEM_free(dataset);
AOM_ask_value_tags(attachments[ii], "TC_Attaches", &n_attachs, &dataset);
for (int i = 0;i < n_attachs;i++) {
stringstream ss;
ss << dir.str().c_str();
ITKCALL(TCTYPE_ask_object_type(dataset[i], &type_tag));
if (type_tag == wordx_tag || type_tag == word_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "word", &ae_ref, &word_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(word_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "word", ss.str().c_str()));
file_type = 0;
} else if (type_tag == excel_tag || type_tag == excelx_tag) {
ITKCALL(AE_ask_dataset_named_ref2(dataset[i], "excel", &ae_ref, &excel_ref));
char *file_name;
ITKCALL(AOM_UIF_ask_value(excel_ref, "file_name", &file_name));
ss << date.str().c_str();
ss << "_";
ss << file_name;
printf("path:%s\n", ss.str().c_str());
ITKCALL(AE_export_named_ref(dataset[i], "excel", ss.str().c_str()));
file_type = 1;
}
printf("file_type:%d\n", file_type);
if (file_type == 0) {
class_Test = env->FindClass("sign2file/SignToWord");
int res = sign(env, class_Test, ss.str().c_str(), user_name, step);
if (res) {
replace_dataset_named_reference(dataset[i], word_ref, ss.str().c_str(), "word");
}
} else if (file_type == 1) {
class_Test = env->FindClass("sign2file/SignToExcel");
int res = sign(env, class_Test, ss.str().c_str(), user_name, step);
if (res) {
replace_dataset_named_reference(dataset[i], excel_ref, ss.str().c_str(), "excel");
}
}
file_type = -1;
}
MEM_free(dataset);
printf("endSign\n");
}
}
FreeLibrary(hModule);
POM_AM__set_application_bypass(false);
return 0;
}
}

@ -1,14 +1,61 @@
 jd_signoff.cpp
C:\work\include12_1\pom/pom/pom.h(816): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\work\include12_1\pom/pom/pom.h(5420): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\work\include12_1\qry/qry.h(591): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\work\include12_1\qry/qry.h(591): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
jd_signoff.cpp(73): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(505): note: 参见“localtime”的声明
 jd_clear_field.cpp
C:\work\include11\pom/pom/pom.h(816): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\work\include11\pom/pom/pom.h(5419): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\work\include11\qry/qry.h(591): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\work\include11\qry/qry.h(591): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
jd_clear_field.cpp(115): warning C4267: “初始化”: 从“size_t”转换到“uint32_t”可能丢失数据
jd_clear_field.cpp(177): warning C4190: “GBKToUTF8”有指定的 C 链接,但返回了与 C 不兼容的 UDT“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring(2633): note: 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明
jd_clear_field.cpp(248): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdlib.h(1183): note: 参见“getenv”的声明
jd_clear_field.cpp(279): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdlib.h(1183): note: 参见“getenv”的声明
jd_clear_field.cpp(281): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“const wchar_t *”
jd_clear_field.cpp(281): note: 请考虑在格式字符串中使用“%ls”
jd_clear_field.cpp(281): note: 请考虑在格式字符串中使用“%lls”
jd_clear_field.cpp(281): note: 请考虑在格式字符串中使用“%Ls”
jd_clear_field.cpp(281): note: 请考虑在格式字符串中使用“%ws”
jd_clear_field.cpp(242): warning C4101: “rev_attachments”: 未引用的局部变量
jd_clear_field.cpp(241): warning C4101: “ref_obj”: 未引用的局部变量
jd_clear_field.cpp(239): warning C4101: “attach_type”: 未引用的局部变量
jd_clear_field.cpp(458): warning C4101: “err_function”: 未引用的局部变量
jd_clear_field.cpp(458): warning C4101: “err_string”: 未引用的局部变量
c:\work\vs_workspace\jditk\hezon_itk\jd_clear_field.cpp(332): warning C4793: “JD_Revise_clear”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\work\vs_workspace\jditk\hezon_itk\jd_clear_field.cpp(333): warning C4793: “JD_Revise_clear”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(1442): warning C4793: “JNIEnv_::CallStaticIntMethod”: 编译为本机的函数:
/clr 下不支持 varargs
c:\java\jdk1.8.0_231\include\jni.h(1445): warning C4793: “JNIEnv_::CallStaticIntMethod”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(1447): warning C4793: “JNIEnv_::CallStaticIntMethod”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(1352): warning C4793: “JNIEnv_::CallStaticObjectMethod”: 编译为本机的函数:
/clr 下不支持 varargs
c:\java\jdk1.8.0_231\include\jni.h(1355): warning C4793: “JNIEnv_::CallStaticObjectMethod”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(1357): warning C4793: “JNIEnv_::CallStaticObjectMethod”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(868): warning C4793: “JNIEnv_::NewObject”: 编译为本机的函数:
/clr 下不支持 varargs
c:\java\jdk1.8.0_231\include\jni.h(871): warning C4793: “JNIEnv_::NewObject”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(873): warning C4793: “JNIEnv_::NewObject”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(1051): warning C4793: “JNIEnv_::CallVoidMethod”: 编译为本机的函数:
/clr 下不支持 varargs
c:\java\jdk1.8.0_231\include\jni.h(1053): warning C4793: “JNIEnv_::CallVoidMethod”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
c:\java\jdk1.8.0_231\include\jni.h(1055): warning C4793: “JNIEnv_::CallVoidMethod”: 编译为本机的函数:
托管代码中发现一个不受支持的内部函数
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1189,5): warning MSB8012: TargetPath(C:\work\vs_workspace\jditk\x64\Release\HEZON_ITK.dll) does not match the Linker's OutputFile property value (C:\work\vs_workspace\jditk\x64\Release\bs.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1191,5): warning MSB8012: TargetName(HEZON_ITK) does not match the Linker's OutputFile property value (bs). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
MSVCRT.lib(default_local_stdio_options.obj) : warning LNK4006: __local_stdio_printf_options 已在 libassy_jt.lib(libassy_jt.dll) 中定义;已忽略第二个定义
jd_signoff.obj : warning LNK4006: "bool __cdecl isTypeOf(unsigned int,char const *)" (?isTypeOf@@$$FYA_NIPEBD@Z) 已在 bs_sap.obj 中定义;已忽略第二个定义
jd_signoff.obj : warning LNK4006: "bool __cdecl isTypeOf(unsigned int,char const *)" (?isTypeOf@@YA_NIPEBD@Z) 已在 bs_sap.obj 中定义;已忽略第二个定义
LINK : warning LNK4103: 导入删除的析构函数“[thunk]:public: virtual void * __ptr64 __cdecl std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vector deleting destructor'`vtordisp{4294967292,0}' (unsigned int) __ptr64”映像可能不能正确运行
正在创建库 C:\work\vs_workspace\jditk\x64\Release\\bs.lib 和对象 C:\work\vs_workspace\jditk\x64\Release\\bs.exp
jd_signoff.obj : warning LNK4248: 无法解析 typeref 标记(01000016)(为“_jmethodID”);映像可能无法运行
jd_clear_field.obj : warning LNK4248: 无法解析 typeref 标记(01000017)(为“_jmethodID”);映像可能无法运行
C:\work\vs_workspace\jditk\x64\Release\\bs.dll : warning LNK4088: 因 /FORCE 选项生成了映像;映像可能不能运行
HEZON_ITK.vcxproj -> C:\work\vs_workspace\jditk\x64\Release\HEZON_ITK.dll
HEZON_ITK.vcxproj -> C:\work\vs_workspace\jditk\x64\Release\HEZON_ITK.pdb (Full PDB)

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save