commit 8b69365c4e5cceb3b552a74d239a3d9b6903c7e1 Author: xiongcz Date: Tue Jun 3 16:39:03 2025 +0800 build(SB): 备份 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..463c03e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# ĬϺԵļ +/shelf/ +/workspace.xml +# ڱ༭ HTTP ͻ +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3fa6af8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + JUnit + + + JVM 语言 + + + Java + + + Java 5Java 语言级别迁移帮助Java + + + Java 8Java 语言级别迁移帮助Java + + + Java 语言级别迁移帮助Java + + + JavadocJava + + + Spring + + + Spring AOPSpring + + + TestNGJava + + + 代码成熟度Java + + + 性能Java + + + 数值问题Java + + + 类结构Java + + + 线程问题Java + + + 编译器问题Java + + + + + 用户定义 + + + + + + + + + \ No newline at end of file diff --git a/.vs/SB/v14/.suo b/.vs/SB/v14/.suo new file mode 100644 index 0000000..08ee70f Binary files /dev/null and b/.vs/SB/v14/.suo differ diff --git a/.vs/SB/v16/.suo b/.vs/SB/v16/.suo new file mode 100644 index 0000000..29b2113 Binary files /dev/null and b/.vs/SB/v16/.suo differ diff --git a/.vs/SB/v16/Browse.VC.db b/.vs/SB/v16/Browse.VC.db new file mode 100644 index 0000000..8146838 Binary files /dev/null and b/.vs/SB/v16/Browse.VC.db differ diff --git a/.vs/SB/v16/ipch/AutoPCH/15a707b6fb238396/REGISTER_HANDLER.ipch b/.vs/SB/v16/ipch/AutoPCH/15a707b6fb238396/REGISTER_HANDLER.ipch new file mode 100644 index 0000000..f155bc6 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/15a707b6fb238396/REGISTER_HANDLER.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/1ad24366f6d8cca6/SB_HANDLER.ipch b/.vs/SB/v16/ipch/AutoPCH/1ad24366f6d8cca6/SB_HANDLER.ipch new file mode 100644 index 0000000..2c0ef57 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/1ad24366f6d8cca6/SB_HANDLER.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/4d946508002e053d/SB.ipch b/.vs/SB/v16/ipch/AutoPCH/4d946508002e053d/SB.ipch new file mode 100644 index 0000000..2f9a9bd Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/4d946508002e053d/SB.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/4e8c86f621b1cb9d/SB6_PR_AUTOASSIGN.ipch b/.vs/SB/v16/ipch/AutoPCH/4e8c86f621b1cb9d/SB6_PR_AUTOASSIGN.ipch new file mode 100644 index 0000000..febd390 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/4e8c86f621b1cb9d/SB6_PR_AUTOASSIGN.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/75e6a8697576cc99/MAIN_LIB.ipch b/.vs/SB/v16/ipch/AutoPCH/75e6a8697576cc99/MAIN_LIB.ipch new file mode 100644 index 0000000..94d83d4 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/75e6a8697576cc99/MAIN_LIB.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/9b645aff63adf7b4/STRING_HELPER.ipch b/.vs/SB/v16/ipch/AutoPCH/9b645aff63adf7b4/STRING_HELPER.ipch new file mode 100644 index 0000000..11b5f80 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/9b645aff63adf7b4/STRING_HELPER.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/bda93aeaa2ee9fd9/SB6_PR_AUTOASSIGN.ipch b/.vs/SB/v16/ipch/AutoPCH/bda93aeaa2ee9fd9/SB6_PR_AUTOASSIGN.ipch new file mode 100644 index 0000000..ac60d55 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/bda93aeaa2ee9fd9/SB6_PR_AUTOASSIGN.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/c2c2f80bd6458a3a/REGISTER_HANDLER.ipch b/.vs/SB/v16/ipch/AutoPCH/c2c2f80bd6458a3a/REGISTER_HANDLER.ipch new file mode 100644 index 0000000..ae66bcd Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/c2c2f80bd6458a3a/REGISTER_HANDLER.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/c45520098ce14b1a/SB_HANDLER.ipch b/.vs/SB/v16/ipch/AutoPCH/c45520098ce14b1a/SB_HANDLER.ipch new file mode 100644 index 0000000..ac683f3 Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/c45520098ce14b1a/SB_HANDLER.ipch differ diff --git a/.vs/SB/v16/ipch/AutoPCH/d01ccde3feab8cd5/MAIN_LIB.ipch b/.vs/SB/v16/ipch/AutoPCH/d01ccde3feab8cd5/MAIN_LIB.ipch new file mode 100644 index 0000000..9b8fa9c Binary files /dev/null and b/.vs/SB/v16/ipch/AutoPCH/d01ccde3feab8cd5/MAIN_LIB.ipch differ diff --git a/SB.VC.db b/SB.VC.db new file mode 100644 index 0000000..9e9cf83 Binary files /dev/null and b/SB.VC.db differ diff --git a/SB.sdf b/SB.sdf new file mode 100644 index 0000000..9cc85b0 Binary files /dev/null and b/SB.sdf differ diff --git a/SB.sln b/SB.sln new file mode 100644 index 0000000..0352ebf --- /dev/null +++ b/SB.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SB", "SB\SB.vcxproj", "{C46A29D8-C7B0-429B-9069-EF14C8E5F15A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Debug|x64.ActiveCfg = Debug|x64 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Debug|x64.Build.0 = Debug|x64 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Debug|x86.ActiveCfg = Debug|Win32 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Debug|x86.Build.0 = Debug|Win32 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Release|x64.ActiveCfg = Release|x64 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Release|x64.Build.0 = Release|x64 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Release|x86.ActiveCfg = Release|Win32 + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/SB.v11.suo b/SB.v11.suo new file mode 100644 index 0000000..b57f06c Binary files /dev/null and b/SB.v11.suo differ diff --git a/SB/Main_lib.cpp b/SB/Main_lib.cpp new file mode 100644 index 0000000..d7e59d1 --- /dev/null +++ b/SB/Main_lib.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include "Register_handler.h" +#ifdef __cplusplus + +extern "C" { +#endif + + + /** + * @fn extern "C" DLLAPI int liborigin_register_callbacks + * @return usually return ITK_ok + * @brief liborigin customization entry + * ˺й淶дdllƼ"_"ͷ + */ + DLLAPI int SB_register_callbacks() + { + int ifail = ITK_ok; + TC_write_syslog("*******************************************************************************\n"); + TC_write_syslog("* SB register_callbacks is starting *\n"); + TC_write_syslog("*******************************************************************************\n"); + + ITKCALL(ifail = CUSTOM_register_exit("SB", "USER_gs_shell_init_module",(CUSTOM_EXIT_ftn_t)registerHandler)); + fprintf(stdout, "\n SB register registerHandler completed!\n"); + + + return ifail; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/SB/ReadMe.txt b/SB/ReadMe.txt new file mode 100644 index 0000000..1e948ea --- /dev/null +++ b/SB/ReadMe.txt @@ -0,0 +1,30 @@ +======================================================================== + 控制台应用程序:SB 项目概述 +======================================================================== + +应用程序向导已为您创建了此 SB 应用程序。 + +本文件概要介绍组成 SB 应用程序的每个文件的内容。 + + +SB.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +SB.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +SB.cpp + 这是主应用程序源文件。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h, StdAfx.cpp + 这些文件用于生成名为 SB.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/SB/Register_handler.cpp b/SB/Register_handler.cpp new file mode 100644 index 0000000..daa7ae7 --- /dev/null +++ b/SB/Register_handler.cpp @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#include "Register_handler.h" +#include "SB_handler.h" + + +/* + ׼עṩ̵÷handler +*/ +extern DLLAPI int registerHandler(int *decision, va_list args) +{ + int ifail = ITK_ok; + + ifail = EPM_register_action_handler("Lao", "Lao", (EPM_action_handler_t)Lao); + if (ifail == 0) { + printf("Register action handler Lao successful\n"); + } + else { + printf("Register action handler Lao failed %d\n", ifail); + } + + ifail = EPM_register_action_handler("Xin", "Xin", (EPM_action_handler_t)Xin); + if (ifail == 0) { + printf("Register action handler Xin successful\n"); + } + else { + printf("Register action handler Xin failed %d\n", ifail); + } + + ifail = EPM_register_action_handler("convertToPDF", "convertToPDF", (EPM_action_handler_t)convertToPDF); + if (ifail == 0) { + printf("Register action handler convertToPDF successful\n"); + } + else { + printf("Register action handler convertToPDF failed %d\n", ifail); + } + + ifail = EPM_register_action_handler("SB_controlled_Lao", "SB_controlled_Lao", (EPM_action_handler_t)SB_controlled_Lao); + if (ifail == 0) { + printf("Register action handler SB_controlled_Lao successful\n"); + } + else { + printf("Register action handler SB_controlled_Lao failed %d\n", ifail); + } + + ifail = EPM_register_action_handler("SB_controlled_Xin", "SB_controlled_Xin", (EPM_action_handler_t)SB_controlled_Xin); + if (ifail == 0) { + printf("Register action handler SB_controlled_Xin successful\n"); + } + else { + printf("Register action handler SB_controlled_Xin failed %d\n", ifail); + } + + ifail = EPM_register_action_handler("SB6_PR_AutoAssign", "SB6_PR_AutoAssign", (EPM_action_handler_t)SB6_PR_AutoAssign); + if (ifail == 0) { + printf("Register action handler SB6_PR_AutoAssign successful\n"); + } + else { + printf("Register action handler SB6_PR_AutoAssign failed %d\n", ifail); + } + + ifail = EPM_register_rule_handler("Origin_CheckTask_handler2", "Origin_CheckTask_handler2", (EPM_rule_handler_t)Origin_CheckTask_handler2); + if (ifail == 0) { + printf("Register rule handler Origin_CheckTask_handler2 successful\n"); + } + else { + printf("Register rule handler Origin_CheckTask_handler2 failed %d\n", ifail); + } + + return ifail; +} diff --git a/SB/Register_handler.h b/SB/Register_handler.h new file mode 100644 index 0000000..0c315dc --- /dev/null +++ b/SB/Register_handler.h @@ -0,0 +1,13 @@ +#ifndef EPM_REGISTER_HANDLER_CUSTOM +#define EPM_REGISTER_HANDLER_CUSTOM +#include +#ifdef __cplusplus + +extern "C" { +#endif + extern DLLAPI int registerHandler(int *, va_list); +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/SB/SB.cpp b/SB/SB.cpp new file mode 100644 index 0000000..587259b --- /dev/null +++ b/SB/SB.cpp @@ -0,0 +1,11 @@ +// SB.cpp : ̨Ӧóڵ㡣 +// + +#include "stdafx.h" + + +int main() +{ + return 0; +} + diff --git a/SB/SB.vcxproj b/SB/SB.vcxproj new file mode 100644 index 0000000..fc9a5aa --- /dev/null +++ b/SB/SB.vcxproj @@ -0,0 +1,173 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {C46A29D8-C7B0-429B-9069-EF14C8E5F15A} + Win32Proj + SB + 10.0.19041.0 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;IPLIB=none;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + true + D:\WorkEnvironment\LiYuan\include;D:\WorkEnvironment\LiYuan\include_cpp;C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include;C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp;%(AdditionalIncludeDirectories) + + + Console + true + true + true + D:\WorkEnvironment\LiYuan\lib\*.lib;C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries) + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SB/SB.vcxproj.filters b/SB/SB.vcxproj.filters new file mode 100644 index 0000000..beacf26 --- /dev/null +++ b/SB/SB.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + \ No newline at end of file diff --git a/SB/SB.vcxproj.user b/SB/SB.vcxproj.user new file mode 100644 index 0000000..abe8dd8 --- /dev/null +++ b/SB/SB.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SB/SB6_PR_AutoAssign.cpp b/SB/SB6_PR_AutoAssign.cpp new file mode 100644 index 0000000..21f74a8 --- /dev/null +++ b/SB/SB6_PR_AutoAssign.cpp @@ -0,0 +1,598 @@ +#include "SB_handler.h" +#include "string_helper.h" +using namespace std; +#include +#include +#include +#include +#include +#include +#define debug true +#define ITK_err 919012 + +bool inArrays(const std::vector& vec, const std::string& value) { + for (const auto& item : vec) { + if (item == value) { + return true; + } + } + return false; +} + +void getVector(const char* value, std::vector& targetVector, char delimiter) { + std::string strValue(value); + std::stringstream ss(strValue); + std::string item; + + // ָķַָָ + if (std::getline(ss, item, delimiter)) { + // ܳɹָָʣಿ + targetVector.push_back(item); + while (std::getline(ss, item, delimiter)) { + targetVector.push_back(item); + } + } + else { + // ָܷַӵvector + targetVector.push_back(strValue); + } +} + +int getPrefStrings(const char* preference, TC_preference_search_scope_t scope, vector& pref_vec) +{ + int ifail = ITK_ok, i = 0, j = 0, k = 0, num = 0; + char** values; + TC_preference_search_scope_t old_scope; + //ITKCALL(ifail = PREF_ask_search_scope(&old_scope)); + //ITKCALL(ifail = PREF_set_search_scope(scope)); + //ITKCALL(ifail = PREF_ask_char_values(preference, &num, &values)); + ITKCALL(ifail = PREF_ask_char_values_at_location(preference, scope, &num, &values)); + if (ifail != ITK_ok) { + return ifail; + } + for (i = 0; i < num; i++) + { + pref_vec.push_back(values[i]); + } + MEM_free(values); + + //ITKCALL(ifail = PREF_set_search_scope(old_scope)); + return ifail; +} + +void setProcessPointUser(std::string uerID) { + + tag_t subtask; //̽ڵ + string id;//ûid + + POM_AM__set_application_bypass(true); + tag_t tmp_select_signoff_task = NULLTAG; + ITKCALL(EPM_ask_sub_task(subtask, EPM_select_signoff_team_task, &tmp_select_signoff_task)); + + tag_t user; + ITKCALL(SA_find_user2(uerID.c_str(), &user)); + + int signoff_cnt = 0; + tag_t* signoffs = NULL; + + tag_t member = NULL; + SIGNOFF_TYPE_t type; + ITKCALL(EPM_ask_signoff_member(tmp_select_signoff_task, &member, &type)); + ITKCALL(EPM_remove_signoffs(tmp_select_signoff_task, 1, &member)); + + ITKCALL(EPM_create_adhoc_signoff(tmp_select_signoff_task, user, &signoff_cnt, &signoffs)); + ITKCALL(EPM_set_adhoc_signoff_selection_done(tmp_select_signoff_task, true)); + + if (signoffs) + { + MEM_free(signoffs); + signoffs = NULL; + } + POM_AM__set_application_bypass(false); + +} + +int SB6_PR_AutoAssign(EPM_action_message_t msg) { + printf("========================= SB6_PR_AutoAssign Start ===================\n"); + int ifail = ITK_ok; + char* argName = NULL, * argValue = NULL, * arg = NULL; + char objTypes[1024] = "", props[1024] = "",pre_str[1024] = ""; + bool isExistRev = false; + int arg_cnt = TC_number_of_arguments(msg.arguments); + printf("Ϊ%d\n", arg_cnt); + + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ifail = ITK_ask_argument_named_value((const char*)arg, &argName, &argValue); + if (strcmp(argName, "type") == 0) + { + if (argValue != NULL) + { + strcpy(objTypes, argValue); + } + } + else if (stricmp(argName, "property") == 0) + { + if (argValue != NULL) + { + strcpy(props, argValue); + } + } + else if (stricmp(argName, "Option") == 0) + { + if (argValue != NULL) + { + strcpy(pre_str, argValue); + } + } + } + } + MEM_free(argName); + MEM_free(argValue); + std::vector typeVector, propVector; + getVector(objTypes, typeVector, ';'); + getVector(props, propVector, ';'); + int prop_cnt = propVector.size(); + + vector pre_values; + if (pre_str != "") { + getPrefStrings(pre_str, TC_preference_site, pre_values); + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "SB6_PR_AutoAssignHandlerOptionõѡΪ!"); + return ITK_err; + } + + std::vector> preVectors; + int pre_cnt = 0; + for (const auto& value : pre_values) { + printf("ѡֵΪ: %s\n", value.c_str()); + std::vector preVector; + getVector(value.c_str(), preVector, ';'); + if (pre_cnt == 0) { + pre_cnt = preVector.size(); + } + else if(prop_cnt != pre_cnt || pre_cnt != preVector.size()) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "SB6_PR_AutoAssignHandlerOptionѡóȲһ!"); + return ITK_err; + } + preVectors.push_back(preVector); + } + + tag_t attachmentTag = NULLTAG; + int attachmentCount = 0; + tag_t rootTask = NULLTAG, * attachmentTags = NULLTAG; + ITKCALL(ifail = EPM_ask_root_task(msg.task, &rootTask)); + ITKCALL(ifail = EPM_ask_attachments(rootTask, EPM_target_attachment, &attachmentCount, &attachmentTags)); + //еĿµĶ + char* itemType = NULL; + for (int i = 0; i < attachmentCount; i++) { + attachmentTag = attachmentTags[i]; + + ITKCALL(ifail = AOM_ask_value_string(attachmentTag, "object_type", &itemType)); + printf("ǰĿµĶΪ: %s\n", itemType); + if (inArrays(typeVector, itemType)) { + ITKCALL(ifail = AOM_lock(attachmentTag)); + //ITKCALL(ifail = AOM_set_value_string(attachmentTag, targetPropertyName, &propertyValue)); + std::vector valueVector; + char* tempValue = NULL; + for (const auto& prop : propVector) { + printf("==>ȡ: %s\n", prop); + ITKCALL(ifail = AOM_UIF_ask_value(attachmentTag, prop.c_str(), &tempValue)); + printf("ֵΪ: %s\n", tempValue); + if (tempValue != NULL) { + valueVector.push_back(tempValue); + } + else { + valueVector.push_back(""); + } + } + MEM_free(tempValue); + + std::string userID; + boolean isMatch = false; + for (const auto& preVector : preVectors) { + printf("preVector: %d\n", preVector.size()); + // ԱÿֵǷƥ + for (size_t i = 0; i < preVector.size(); ++i) { + printf("ȶֵ: %s || %s\n", preVector[i], valueVector[i]); + if (i == preVector.size() - 1) { + // 滻Ϊָ߼ + std::string keyValuePair = preVector.back(); + std::vector tempVector; + getVector(keyValuePair.c_str(), tempVector, '='); + + if (tempVector.size() == 2) { + if (tempVector[0] == valueVector[i]) { + userID = tempVector[1]; // ȡȺźIJ + isMatch = true; + break; + } + } + else { + // Ҫӣ + userID = ""; + printf("ûIDʽȷ: %s\n", keyValuePair.c_str()); + EMH_store_error_s1(EMH_severity_error, ITK_err, "ûIDʽȷ"); + return ITK_err; + } + } + else if (preVector[i] != valueVector[i]) { + break; + } + } + if (isMatch) { + break; + } + } + if (userID.empty()) { + continue; + } + printf("UserId : %s\n", userID); + + //setProcessPointUser(userID); + POM_AM__set_application_bypass(true); + int mem_cnt = 0, signoff_cnt = 0, signmem_count = 0, * attach_type; + tag_t user_tag = NULLTAG, login_group = NULLTAG, * members = NULLTAG, * signoffs = NULLTAG, select_signoff_tag = NULLTAG, * attachmentTags = NULLTAG; + EPM_ask_sub_task(msg.task, EPM_select_signoff_team_task, &select_signoff_tag); + EPM_ask_all_attachments(select_signoff_tag, &signmem_count, &attachmentTags, &attach_type); + if (signmem_count == 0) { + ITKCALL(SA_find_user2(userID.c_str(), &user_tag)); + if (user_tag != NULLTAG) { + ITKCALL(SA_ask_user_login_group(user_tag, &login_group)); + ITKCALL(SA_find_groupmembers(user_tag, login_group, &mem_cnt, &members)); + ITKCALL(EPM_create_adhoc_signoff(select_signoff_tag, user_tag, &signoff_cnt, &signoffs)); + ITKCALL(EPM_set_adhoc_signoff_selection_done(select_signoff_tag, true)); + printf("ɹ"); + break; + } + else { + printf("nulll\n"); + ITKCALL(EPM_promote_task(msg.task, "")); + } + } + POM_AM__set_application_bypass(false); + MEM_free(members); + MEM_free(signoffs); + + ITKCALL(ifail = AOM_unlock(attachmentTag)); + } + } + MEM_free(attachmentTags); + MEM_free(itemType); + return ifail; +} + + + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + +/** + * жijǷ + * + * @param objtag ҪжϵĶ + * @param type_name ͵ + * + */ +int checkIsTypeOrSubtype(tag_t objtag, char* type_name) { + tag_t type = NULLTAG, + item_type = NULLTAG; + int is_type = 0; + char* tag_name = NULL; + + + ITKCALL(AOM_ask_value_string(objtag, "object_name", &tag_name)); + if (tag_name == NULL) + { + tag_name = "NULL"; + } + ITKCALL(TCTYPE_ask_object_type(objtag, &type)); + ITKCALL(TCTYPE_find_type(type_name, "", &item_type)); + logical isok = false; + if (item_type != NULLTAG) { + logical isok = FALSE; + ITKCALL(TCTYPE_is_type_of(type, item_type, &isok)); + if (isok) + { + //LOG_ECHO(("%s\n", type_name)); + printf("%s%s\n", tag_name, type_name); + is_type = 1; + } + else + { + //LOG_ECHO(("%s\n", type_name)); + printf("%s%s\n", tag_name, type_name); + is_type = 0; + } + } + DOFREE(tag_name); + return is_type; +} + + +/** +* жǷͬԴ +*/ +bool isTypeOf1(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; +} + +/** +* @brief ݲȷ͵tag_t󣬻ȡitemitemRev +* @param check_tag +* @param item_tag +* @param rev_tag +* @return +*/ +int get_item_and_rev(tag_t check_tag, tag_t* item_tag, tag_t* rev_tag) { + int ifail = ITK_ok; + if (isTypeOf1(check_tag, "Item")) { + printf("====ǰĶitem\n"); + *item_tag = check_tag; + ITEM_ask_latest_rev(*item_tag, rev_tag); + } + else if (isTypeOf1(check_tag, "ItemRevision")) { + printf("====ǰĶRevision\n"); + *rev_tag = check_tag; + ITEM_ask_item_of_rev(*rev_tag, item_tag); + } + return ifail; +} + +/*=============================================================================* + * FUNCTION: Origin_CheckTask_handler2 + * PURPOSE : У齻ļǷ񷢲 + * INPUT: + * EPM_rule_message_t msg + * + * RETURN: + * int + *============================================================================*/ +int Origin_CheckTask_handler2(EPM_rule_message_t msg) +{ + EPM_decision_t err = EPM_go; + int ifail = ITK_ok; + + int project_attachment_cnt = 0, + deliverable_cnt = 0, + sc_cnt = 0, + fold_cnt = 0, + fold_content_cnt = 0, + status_cnt = 0; + + bool allowPass = true; + bool noItem = false; + bool status_is_configured = false; + + tag_t* project_attachments = NULLTAG, + * deliverable_list = NULLTAG, + deliverable = NULLTAG, + * folds = NULLTAG, + * fold_contents = NULLTAG, + * status_list = NULLTAG, + item_tag = NULLTAG, + check_item = NULLTAG; + + char* object_type = NULL; + //״̬ + char* status_name = NULL; + //õ״̬ + char status_config[1024] = ""; + char *arg = NULL, + *argName = NULL, + *argValue = NULL; + + /*LOG_ECHO(("*******************************************************************************\n")); + LOG_ECHO(("* Origin_CheckTask_handler is comming ! *\n")); + LOG_ECHO(("*******************************************************************************\n"));*/ + printf("*******************************************************************************\n"); + printf("* Origin_CheckTask_handler is comming ! *\n"); + printf("*******************************************************************************\n"); + + //TODO ȡõIJǵøstatus_is_configuredֵΪtrue + int arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + printf("õIJΪ%d\n", arg_cnt); + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argName, &argValue)); + printf("-ֵ = [%s - %s]\n", argName, argValue); + if (argName != NULL && argValue != NULL && strcmp(argName, "status") == 0) { + printf("״̬ƣ%s\n", argValue); + strcpy(status_config, argValue); + status_is_configured = true; + } + DOFREE(argName); + DOFREE(argValue); + } + + } + else + { + printf("ûò\n"); + } + + ITKCALL(AOM_ask_value_tags(msg.task, "project_task_attachments", &project_attachment_cnt, &project_attachments)); + if (project_attachment_cnt > 0) + { + ITKCALL(AOM_ask_value_tags(project_attachments[0], "sch_task_deliverable_list", &deliverable_cnt, &deliverable_list)); + if (deliverable_cnt > 0) + { + ITKCALL(AOM_ask_value_tag(deliverable_list[0], "schedule_deliverable", &deliverable)); + if (deliverable != NULL) + { + ITKCALL(AOM_ask_value_tags(deliverable, "deliverable_inst", &fold_cnt, &folds)); + if (fold_cnt > 0) + { + allowPass = false; + ITKCALL(AOM_ask_value_tags(folds[0], "contents", &fold_content_cnt, &fold_contents));//ȡļµ + //LOG_ECHO(("ļ%d\n", fold_content_cnt)); + printf("ļ%d\n", fold_content_cnt); + + if (status_is_configured) {//̲״̬ + int hi_cnt = 0; + printf("̲״̬\n"); + //ļµĽ + for (int i = 0; i < fold_content_cnt; i++) + { + ITKCALL(AOM_ask_value_string(fold_contents[i], "object_type", &object_type)); + //ݽͣȡcheck_item + if (checkIsTypeOrSubtype(fold_contents[i], "Item") == 1 + || checkIsTypeOrSubtype(fold_contents[i], "ItemRevision") == 1) + { + hi_cnt++; + ITKCALL(get_item_and_rev(fold_contents[i], &item_tag, &check_item)); + printf("1 \n"); + } + else { + continue; + } + + //жϽӦcheck_itemǷ񷢲 + if (check_item != NULL) + { + printf("ȡ°汾ɹ\n"); + ITKCALL(AOM_ask_value_tags(check_item, "release_status_list", &status_cnt, &status_list)); + if (status_cnt > 0) + { + for (int j = 0; j < status_cnt; j++) + { + //status_list[j];//״̬ + ITKCALL(AOM_ask_value_string(status_list[j], "object_name", &status_name)); + if (status_name == NULL) { + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûзȽз")); + err = EPM_nogo; + break; + } + if (status_name == NULL) { + continue; + } + if (strcmp(status_name, status_config) == 0) + { + printf("﷢״̬[%s]õķ״̬[%s]ͬ\n", status_name, status_config); + allowPass = true; + } + else + { + printf("﷢״̬[%s]õķ״̬[%s]ͬ\n", status_name, status_config); + allowPass = false; + string err_msg = "ļµĶ汾״̬Ҫ"+ string(status_config) +"һ£"; + + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, err_msg.c_str())); + err = EPM_nogo; + break; + } + + } + } + else + {//ļ´δĶ + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûзȽз")); + err = EPM_nogo; + break; + } + } + else + { + printf("ȡcheck_item ʧܣ"); + continue; + } + DOFREE(status_name); + DOFREE(status_list); + } + if (hi_cnt == 0) {//״̬£ļûitem\rev + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûύȽύ")); + err = EPM_nogo; + } + + } + else + {//̲δ״̬ + printf("̲δ״̬\n"); + int ir_cnt = 0; + if (fold_content_cnt > 0) + { + //û״̬ʱ򣬼ļǷitem\rev࣬ͨʾ + for (int j = 0; j < fold_content_cnt; j++) { + if (checkIsTypeOrSubtype(fold_contents[j], "Item") == 1 + || checkIsTypeOrSubtype(fold_contents[j], "ItemRevision") == 1) { + ir_cnt++; + } + } + if (ir_cnt == 0) { + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûύȽύ")); + allowPass = false; + err = EPM_nogo; + } + else { + allowPass = true;//ļ + } + + }else {//δ̲ļҲû + printf("Уͨδ̲ҽļûݣ\n"); + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûύȽύ")); + err = EPM_nogo; + } + } + + + + } + } + } + } + + + //if (!allowPass && status_is_configured == false) + //{ + // //LOG_ECHO(("У鲻ͨڽδ\n")); + // printf("У鲻ͨڽδύ\n"); + // ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûύȽύ")); + // err = EPM_nogo; + //} + //else if (!allowPass) { + // printf("У鲻ͨڽδ\n"); + // ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, "ûзȽз")); + // err = EPM_nogo; + //} + + //LOG_ECHO(("*******************************************************************************\n")); + //LOG_ECHO(("* Origin_CheckTask_handler is end ! *\n")); + //LOG_ECHO(("*******************************************************************************\n")); + printf("*******************************************************************************\n"); + printf("* Origin_CheckTask_handler is end ! *\n"); + printf("*******************************************************************************\n"); + + //DOFREE(status_config); + DOFREE(object_type); + DOFREE(fold_contents); + DOFREE(folds); + DOFREE(project_attachments); + DOFREE(project_attachments); + + return err; + +} diff --git a/SB/SB_handler.cpp b/SB/SB_handler.cpp new file mode 100644 index 0000000..c18a95d --- /dev/null +++ b/SB/SB_handler.cpp @@ -0,0 +1,1372 @@ +#include "SB_handler.h" +#include "string_helper.h" +using namespace std; + +#include +#include +#include +#include +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +#include +namespace fs = std::experimental::filesystem; + +void removeLogsFile() { + fs::path filePath("C:\\logs.txt"); + if (fs::exists(filePath)) { + fs::remove(filePath); + std::cout << "ļɾ: " << filePath << std::endl; + } + else { + std::cout << "ļ: " << filePath << std::endl; + } +} + +// ȡǰʱַʾ +std::string getCurrentTime() { + std::time_t now = std::time(nullptr); + std::tm* now_tm = std::localtime(&now); + char buffer[20]; + std::strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", now_tm); + return std::string(buffer); +} + +// д־Ϣļ writeLog("ǰʱ: "+ std::to_string(totalGs)); +void writeLog(const std::string& message) { + std::ofstream logFile("C:\\logs.txt", std::ios_base::app); // ׷ģʽļ + if (logFile.is_open()) { + std::string logEntry = "[" + getCurrentTime() + "] " + message + "\n"; + logFile << logEntry; + logFile.close(); + } + else { + std::cerr << "޷־ļ" << std::endl; + } +} + + + + +int Lao(EPM_action_message_t msg) +{ + int ifail = ITK_ok, sub_cnt = 0, perform_count = 0, *perform_type, attachment_cnt = 0, ds_cnt = 0, ref_cnt = 0; + tag_t root_task = NULLTAG, *sub_tasks = NULLTAG, sub_task = NULLTAG, + owner = NULLTAG, perform_task = NULLTAG, *perform_attaches = NULLTAG, + member_tag = NULLTAG, *attachments = NULLTAG, item = NULLTAG, + itemRev = NULLTAG, type_tag, relation_type, *secondary_objects = NULLTAG, *refs = NULLTAG; + char *type = NULL, *date_format = "%Y-%m-%d", *timeinfo = NULL, *name = NULL, + *person_name = NULL, *comments = NULL, *dir = NULL; + date_t mod_date = NULLDATE, decision_date = NULLDATE; + char content[512] = "", buf[64] = "", path[256] = ""; + SIGNOFF_TYPE_t member_type; + EPM_signoff_decision_t signoff_decision; + time_t t = NULL; + size_t buffer_cnt = 32; + tm *local; + FILE *fw; + errno_t error; + + ITKCALL(EPM_ask_root_task(msg.task, &root_task)); + ITKCALL(EPM_ask_sub_tasks(root_task, &sub_cnt, &sub_tasks)); + for (int i = 0; i < sub_cnt; i++) + { + sub_task = sub_tasks[i]; + ITKCALL(WSOM_ask_name2(sub_task, &name)); + ITKCALL(WSOM_ask_object_type2(sub_task, &type)); + + if (stricmp("EPMDoTask", type) == 0) + { + ITKCALL(AOM_ask_owner(sub_task, &owner)); + ITKCALL(SA_ask_user_person_name2(owner, &person_name)); + ITKCALL(AOM_ask_value_date(sub_task, "last_mod_date", &mod_date)); + ITKCALL(DATE_date_to_string(mod_date, date_format, &timeinfo)); + + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(person_name) + 1, person_name); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("") + 1, ""); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(timeinfo) + 1, timeinfo); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + } + else if (stricmp("EPMReviewTask", type) == 0) + { + + ITKCALL(EPM_ask_sub_task(sub_task, "perform-signoffs", &perform_task)); + ITKCALL(EPM_ask_all_attachments(perform_task, &perform_count, &perform_attaches, &perform_type)); + for (int j = 0; j < perform_count; j++) + { + ITKCALL(EPM_ask_signoff_member(perform_attaches[j], &member_tag, &member_type)); + ITKCALL(EPM_ask_signoff_decision(perform_attaches[j], &signoff_decision, &comments, &decision_date)); + if (member_type == SIGNOFF_GROUPMEMBER) + { + ITKCALL(SA_ask_groupmember_user(member_tag, &owner)); + ITKCALL(SA_ask_user_person_name2(owner, &person_name)); + ITKCALL(DATE_date_to_string(decision_date, date_format, &timeinfo)); + + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(person_name) + 1, person_name); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("") + 1, ""); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(timeinfo) + 1, timeinfo); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + } + } + if (perform_attaches) { MEM_free(perform_attaches); perform_attaches = NULL; } + if (perform_type) { MEM_free(perform_type); perform_type = NULL; } + if (comments) { MEM_free(comments); comments = NULL; } + } + + if (person_name) { MEM_free(person_name); person_name = NULL; } + if (timeinfo) { MEM_free(timeinfo); timeinfo = NULL; } + if (name) { MEM_free(name); name = NULL; } + if (type) { MEM_free(type); type = NULL; } + } + + if (sub_tasks) { MEM_free(sub_tasks); sub_tasks = NULL; } + printf("sign content: %s\n", content); + + _dupenv_s(&dir, &buffer_cnt, "temp"); + local = new tm(); + t = time(NULL); + localtime_s(local, &t); + strftime(buf, 64, "%Y-%m-%d-%H-%M-%S.bat", local); + + if (dir[strlen(dir) - 1] == '\\') + { + sprintf_s(path, "%s%s", dir, buf); + } + else + { + sprintf_s(path, "%s\\%s", dir, buf); + } + error = fopen_s(&fw, path, "a+"); + if (error == 0) + { + fwrite(content, sizeof(char), strlen(content), fw); + fclose(fw); + } + if (local != NULL) + { + delete local; + local = NULL; + } + + POM_AM__set_application_bypass(true); + + ITKCALL(EPM_ask_attachments(root_task, EPM_target_attachment, &attachment_cnt, &attachments)); + for (int i = 0; i < attachment_cnt; i++) + { + itemRev = attachments[i]; + ITKCALL(TCTYPE_ask_object_type(itemRev, &type_tag)); + ITKCALL(TCTYPE_ask_class_name2(type_tag, &name)); + + if ((strstr(name, "Revision") != NULL) || (strstr(name, "revision") != NULL)) + { + printf("1111\n"); + ITKCALL(ITEM_ask_item_of_rev(itemRev, &item)); + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(GRM_list_secondary_objects_only(itemRev, relation_type, &ds_cnt, &secondary_objects)); + for (int j = 0; j < ds_cnt; j++) + { + ITKCALL(AOM_ask_value_string(secondary_objects[j], "object_type", &type)); + if ((stricmp(type, "PDF") == 0) || (stricmp(type, "MSExcelX") == 0)) { + ITKCALL(AOM_ask_value_tags(secondary_objects[j], "ref_list", &ref_cnt, &refs)); + if (ref_cnt < 1) { + printf("ref is error\n"); + continue; + } + if (strcmp(type, "PDF") == 0) + { + printf("sign pdf start\n"); + Lao_excute_pdf(secondary_objects[j], path, buf, "pdf"); + printf("sign pdf end\n"); + } + if (refs) { MEM_free(refs); type = NULL; } + } + else + { + printf("type is not pdf, type: %s\n", type); + if (type) { MEM_free(type); type = NULL; } + continue; + } + } + } + } + + POM_AM__set_application_bypass(false); + return ifail; +} + +int Lao_excute_pdf(tag_t dateset, char *file_path, char *file_name, char* ext) +{ + int ifail = ITK_ok; + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG; + AE_reference_type_t ref_type; + char ref_name[WSO_name_size_c + 1] = "PDF_Reference"; + ITKCALL(AE_ask_dataset_latest_rev(dateset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &ref_type, &ref_object)); + + char *pathname = NULL; + char *origin_file_name = NULL; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + printf("pathname: %s, origin_file_name: %s\n", pathname, origin_file_name); + + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + string newName = new_file_name; + if (newName.find(".PDF") == string::npos && newName.find(".pdf") == string::npos) + { + strcat(new_file_name, ".PDF"); + } + printf("new_file_name: %s\n", new_file_name); + + char *temp_dir = nullptr; + size_t s1 = 0; + _dupenv_s(&temp_dir, &s1, "temp"); + + char in_file[256] = ""; + char out_file[256] = ""; + strcpy_s(in_file, strlen(temp_dir) + 1, temp_dir); + strcpy_s(in_file, strlen("\\") + 1, "\\"); + strcpy_s(in_file, strlen(new_file_name) + 1, new_file_name); + sprintf_s(out_file, 128, "%d-%s", 2, in_file); + IMF_export_file(ref_object, in_file); + + char cmd[256] = ""; + char *tc_root_dir = nullptr; + size_t s2 = 0; + _dupenv_s(&tc_root_dir, &s2, "tc_root"); + strcpy_s(cmd, strlen("java -jar ") + 1, "java -jar "); + strcat_s(cmd, strlen(cmd) + strlen(tc_root_dir) + 1, tc_root_dir); + strcat_s(cmd, strlen(cmd) + strlen("\\bin\\SignPdfLao.jar") + 1, "\\bin\\SignPdfLao.jar"); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(file_path) + 1, file_path); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(in_file) + 1, in_file); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(out_file) + 1, out_file); + printf("cmd: %s\n", cmd); + system(cmd); + + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + ITKCALL(IMF_import_file(out_file, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + ITKCALL(IMF_set_original_file_name2(new_file_tag, origin_file_name)); + ITKCALL(IMF_close_file(file_descriptor)); + ITKCALL(AOM_save(new_file_tag)); + ITKCALL(AOM_unlock(new_file_tag)); + + ITKCALL(AOM_lock(spec_dataset_rev)); + ITKCALL(AE_remove_dataset_named_ref_by_tag2(spec_dataset_rev, ref_name, ref_object)); + ITKCALL(AE_add_dataset_named_ref2(spec_dataset_rev, ref_name, AE_PART_OF, new_file_tag)); + ITKCALL(AOM_save(spec_dataset_rev)); + ITKCALL(AOM_unlock(spec_dataset_rev)); + + remove(in_file); + free(tc_root_dir); + free(temp_dir); + + return ifail; +} + +int Xin(EPM_action_message_t msg) { + int ifail = ITK_ok, sub_cnt = 0, perform_count = 0, *perform_type, attachment_cnt = 0, ds_cnt = 0, ref_cnt = 0; + tag_t root_task = NULLTAG, *sub_tasks = NULLTAG, sub_task = NULLTAG, + owner = NULLTAG, perform_task = NULLTAG, *perform_attaches = NULLTAG, + member_tag = NULLTAG, *attachments = NULLTAG, item = NULLTAG, + itemRev = NULLTAG, type_tag, relation_type, *secondary_objects = NULLTAG, *refs = NULLTAG; + char *type = NULL, *date_format = "%Y-%m-%d", *timeinfo = NULL, *name = NULL, + *person_name = NULL, *comments = NULL, *dir = NULL; + date_t mod_date = NULLDATE, decision_date = NULLDATE; + char content[512] = "", buf[64] = "", path[256] = ""; + SIGNOFF_TYPE_t member_type; + EPM_signoff_decision_t signoff_decision; + time_t t = NULL; + size_t buffer_cnt = 32; + tm *local; + FILE *fw; + errno_t error; + + ITKCALL(EPM_ask_root_task(msg.task, &root_task)); + ITKCALL(EPM_ask_sub_tasks(root_task, &sub_cnt, &sub_tasks)); + for (int i = 0; i < sub_cnt; i++) + { + sub_task = sub_tasks[i]; + ITKCALL(WSOM_ask_name2(sub_task, &name)); + ITKCALL(WSOM_ask_object_type2(sub_task, &type)); + + if (stricmp("EPMDoTask", type) == 0) + { + ITKCALL(AOM_ask_owner(sub_task, &owner)); + ITKCALL(SA_ask_user_person_name2(owner, &person_name)); + ITKCALL(AOM_ask_value_date(sub_task, "last_mod_date", &mod_date)); + ITKCALL(DATE_date_to_string(mod_date, date_format, &timeinfo)); + + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(person_name) + 1, person_name); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("") + 1, ""); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(timeinfo) + 1, timeinfo); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + } + else if (stricmp("EPMReviewTask", type) == 0) + { + + ITKCALL(EPM_ask_sub_task(sub_task, "perform-signoffs", &perform_task)); + ITKCALL(EPM_ask_all_attachments(perform_task, &perform_count, &perform_attaches, &perform_type)); + for (int j = 0; j < perform_count; j++) + { + ITKCALL(EPM_ask_signoff_member(perform_attaches[j], &member_tag, &member_type)); + ITKCALL(EPM_ask_signoff_decision(perform_attaches[j], &signoff_decision, &comments, &decision_date)); + if (member_type == SIGNOFF_GROUPMEMBER) + { + ITKCALL(SA_ask_groupmember_user(member_tag, &owner)); + ITKCALL(SA_ask_user_person_name2(owner, &person_name)); + ITKCALL(DATE_date_to_string(decision_date, date_format, &timeinfo)); + + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(person_name) + 1, person_name); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + strcat_s(content, strlen(content) + strlen(name) + 1, name); + strcat_s(content, strlen(content) + strlen("") + 1, ""); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(timeinfo) + 1, timeinfo); + strcat_s(content, strlen(content) + strlen("|") + 1, "|"); + } + } + if (perform_attaches) { MEM_free(perform_attaches); perform_attaches = NULL; } + if (perform_type) { MEM_free(perform_type); perform_type = NULL; } + if (comments) { MEM_free(comments); comments = NULL; } + } + + if (person_name) { MEM_free(person_name); person_name = NULL; } + if (timeinfo) { MEM_free(timeinfo); timeinfo = NULL; } + if (name) { MEM_free(name); name = NULL; } + if (type) { MEM_free(type); type = NULL; } + } + + if (sub_tasks) { MEM_free(sub_tasks); sub_tasks = NULL; } + printf("sign content: %s\n", content); + + _dupenv_s(&dir, &buffer_cnt, "temp"); + local = new tm(); + t = time(NULL); + localtime_s(local, &t); + strftime(buf, 64, "%Y-%m-%d-%H-%M-%S.bat", local); + + if (dir[strlen(dir) - 1] == '\\') + { + sprintf_s(path, "%s%s", dir, buf); + } + else + { + sprintf_s(path, "%s\\%s", dir, buf); + } + error = fopen_s(&fw, path, "a+"); + if (error == 0) + { + fwrite(content, sizeof(char), strlen(content), fw); + fclose(fw); + } + if (local != NULL) + { + delete local; + local = NULL; + } + + POM_AM__set_application_bypass(true); + + ITKCALL(EPM_ask_attachments(root_task, EPM_target_attachment, &attachment_cnt, &attachments)); + for (int i = 0; i < attachment_cnt; i++) + { + itemRev = attachments[i]; + ITKCALL(TCTYPE_ask_object_type(itemRev, &type_tag)); + ITKCALL(TCTYPE_ask_class_name2(type_tag, &name)); + + if ((strstr(name, "Revision") != NULL) || (strstr(name, "revision") != NULL)) + { + printf("1111\n"); + ITKCALL(ITEM_ask_item_of_rev(itemRev, &item)); + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(GRM_list_secondary_objects_only(itemRev, relation_type, &ds_cnt, &secondary_objects)); + for (int j = 0; j < ds_cnt; j++) + { + ITKCALL(AOM_ask_value_string(secondary_objects[j], "object_type", &type)); + if ((stricmp(type, "PDF") == 0) || (stricmp(type, "MSExcelX") == 0)) { + ITKCALL(AOM_ask_value_tags(secondary_objects[j], "ref_list", &ref_cnt, &refs)); + if (ref_cnt < 1) { + printf("ref is error\n"); + continue; + } + if (strcmp(type, "PDF") == 0) + { + printf("sign pdf start\n"); + Xin_excute_pdf(secondary_objects[j], path, buf, "pdf"); + printf("sign pdf end\n"); + } + if (refs) { MEM_free(refs); type = NULL; } + } + else + { + printf("type is not pdf, type: %s\n", type); + if (type) { MEM_free(type); type = NULL; } + continue; + } + } + } + } + + POM_AM__set_application_bypass(false); + return ifail; +} + +int Xin_excute_pdf(tag_t dateset, char *file_path, char *file_name, char* ext) +{ + int ifail = ITK_ok; + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG; + AE_reference_type_t ref_type; + char ref_name[WSO_name_size_c + 1] = "PDF_Reference"; + ITKCALL(AE_ask_dataset_latest_rev(dateset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &ref_type, &ref_object)); + + char *pathname = NULL; + char *origin_file_name = NULL; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + printf("pathname: %s, origin_file_name: %s\n", pathname, origin_file_name); + + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + string newName = new_file_name; + if (newName.find(".PDF") == string::npos && newName.find(".pdf") == string::npos) + { + strcat(new_file_name, ".PDF"); + } + printf("new_file_name: %s\n", new_file_name); + + char *temp_dir = nullptr; + size_t s1 = 0; + _dupenv_s(&temp_dir, &s1, "temp"); + + char in_file[256] = ""; + char out_file[256] = ""; + strcpy_s(in_file, strlen(temp_dir) + 1, temp_dir); + strcpy_s(in_file, strlen("\\") + 1, "\\"); + strcpy_s(in_file, strlen(new_file_name) + 1, new_file_name); + sprintf_s(out_file, 128, "%d-%s", 2, in_file); + IMF_export_file(ref_object, in_file); + + char cmd[256] = ""; + char *tc_root_dir = nullptr; + size_t s2 = 0; + _dupenv_s(&tc_root_dir, &s2, "tc_root"); + strcpy_s(cmd, strlen("java -jar ") + 1, "java -jar "); + strcat_s(cmd, strlen(cmd) + strlen(tc_root_dir) + 1, tc_root_dir); + strcat_s(cmd, strlen(cmd) + strlen("\\bin\\SignPdfXin.jar") + 1, "\\bin\\SignPdfXin.jar"); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(file_path) + 1, file_path); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(in_file) + 1, in_file); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(out_file) + 1, out_file); + printf("cmd: %s\n", cmd); + system(cmd); + + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + ITKCALL(IMF_import_file(out_file, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + ITKCALL(IMF_set_original_file_name2(new_file_tag, origin_file_name)); + ITKCALL(IMF_close_file(file_descriptor)); + ITKCALL(AOM_save(new_file_tag)); + ITKCALL(AOM_unlock(new_file_tag)); + + ITKCALL(AOM_lock(spec_dataset_rev)); + ITKCALL(AE_remove_dataset_named_ref_by_tag2(spec_dataset_rev, ref_name, ref_object)); + ITKCALL(AE_add_dataset_named_ref2(spec_dataset_rev, ref_name, AE_PART_OF, new_file_tag)); + ITKCALL(AOM_save(spec_dataset_rev)); + ITKCALL(AOM_unlock(spec_dataset_rev)); + + remove(in_file); + free(tc_root_dir); + free(temp_dir); + + return ifail; +} + +int convertToPDF(EPM_action_message_t msg) +{ + int ifail = ITK_ok; + int attachments_cnt = 0; + tag_t root_task, *attachments; + ITKCALL(EPM_ask_root_task(msg.task, &root_task)); + ITKCALL(EPM_ask_attachments(root_task, EPM_target_attachment, &attachments_cnt, &attachments)); + if (attachments_cnt < 0) + { + return ifail; + } + + for (int i = 0; i < attachments_cnt; i++) + { + char *name, *type; + int ds_cnt = 0, ref_cnt = 0; + tag_t type_tag, relation_type, *ds_tags, *refs; + + ITKCALL(TCTYPE_ask_object_type(attachments[i], &type_tag)); + ITKCALL(TCTYPE_ask_class_name2(type_tag, &name)); + + if ((strstr(name, "Revision") != NULL) || (strstr(name, "revision") != NULL)) + { + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(GRM_list_secondary_objects_only(attachments[i], relation_type, &ds_cnt, &ds_tags)); + for (int j = 0; j < ds_cnt; j++) + { + ITKCALL(AOM_ask_value_tags(ds_tags[j], "ref_list", &ref_cnt, &refs)); + if (ref_cnt < 1) + { + continue; + } + + tag_t relation_type = NULLTAG; + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(AOM_ask_value_string(ds_tags[j], "object_type", &type)); + if (stricmp(type, "MSWordX") == 0 || stricmp(type, "MSWord") == 0 + || stricmp(type, "MSExcelX") == 0 || stricmp(type, "MSExcel") == 0) + { + if (strcmp(type, "MSWordX") == 0) + { + startConversion(attachments[i], ds_tags[j], relation_type, "word", ".docx", "\\bin\\wordtopdf.jar"); + } + else if (strcmp(type, "MSWord") == 0) + { + startConversion(attachments[i], ds_tags[j], relation_type, "word", ".doc", "\\bin\\exceltopdf.jar"); + } + else if (strcmp(type, "MSExcelX") == 0) + { + startConversion(attachments[i], ds_tags[j], relation_type, "excel", ".xlsx", "\\bin\\exceltopdf.jar"); + } + else if (strcmp(type, "MSExcel") == 0) + { + startConversion(attachments[i], ds_tags[j], relation_type, "excel", ".xls", "\\bin\\exceltopdf.jar"); + } + } + + if (refs) { MEM_free(refs); type = NULL; } + if (type) { MEM_free(type); type = NULL; } + + } + } + } +} + +void startConversion(tag_t item_rev_tag, tag_t dataset, tag_t rel_tag, char *ref_name, char *ext, char *jar_name) +{ + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG, owner_user = NULLTAG; + char *ds_name = NULL; + AE_reference_type_t reference_type; + + ITKCALL(AOM_ask_owner(dataset, &owner_user)); + ITKCALL(AOM_ask_value_string(dataset, "object_name", &ds_name)); + ITKCALL(AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object)); + + if (reference_type == AE_PART_OF) + { + char *pathname = NULL; + char *origin_file_name = NULL; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + + char new_ds_name[WSO_name_size_c + 1] = ""; + char* new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + char* temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN] = ""; + char temp_file2[SS_MAXPATHLEN] = "\0"; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\"); + strcat(temp_file, ds_name); + + if (strstr(temp_file, ".xlsx") != NULL || strstr(temp_file, ".xlsm") != NULL + || strstr(temp_file, ".docx") != NULL || strstr(temp_file, ".docm") != NULL) + { + char temp_file_temp[SS_MAXPATHLEN] = "\0"; + strncpy(temp_file_temp, temp_file, strlen(temp_file) - 5); + sprintf(temp_file2, "%s.pdf", temp_file_temp); + } + else if (strstr(temp_file, ".xls") != NULL || strstr(temp_file, ".doc") != NULL) + { + char temp_file_temp[SS_MAXPATHLEN] = "\0"; + strncpy(temp_file_temp, temp_file, strlen(temp_file) - 4); + sprintf(temp_file2, "%s.pdf", temp_file_temp); + } + else + { + sprintf(temp_file2, "%s.pdf", temp_file); + } + + IMF_export_file(ref_object, temp_file); + + char cmd[256] = ""; + char *tc_root_dir = nullptr; + size_t s2 = 0; + _dupenv_s(&tc_root_dir, &s2, "tc_root"); + strcpy_s(cmd, strlen("java -jar ") + 1, "java -jar "); + strcat_s(cmd, strlen(cmd) + strlen(tc_root_dir) + 1, tc_root_dir); + strcat_s(cmd, strlen(cmd) + strlen(jar_name) + 1, jar_name); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(temp_file) + 1, temp_file); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(temp_file2) + 1, temp_file2); + printf("\n%s\n", cmd); + system(cmd); + + for (int time_2_pdf = 0; time_2_pdf < 20; time_2_pdf++) + { + Sleep(1000); + if ((_access(temp_file2, 0)) != -1) + { + int size_ftp = 0; + struct stat buf; + if (stat(temp_file2, &buf) < 0) + { + printf("жpdfСʧ\n"); + } + else + { + size_ftp = buf.st_size; + } + + char new_file_temp[SS_MAXPATHLEN] = "\0"; + if (strstr(ds_name, ".xlsx") != NULL || strstr(ds_name, ".xlsm") != NULL + || strstr(ds_name, ".docx") != NULL || strstr(ds_name, ".docm") != NULL) + { + char temp_file_temp[SS_MAXPATHLEN] = "\0"; + strncpy(temp_file_temp, ds_name, strlen(ds_name) - 5); + sprintf(new_file_temp, "%s.pdf", temp_file_temp); + sprintf(ds_name, "%s.pdf", temp_file_temp); + } + else if (strstr(ds_name, ".xls") != NULL || strstr(ds_name, ".doc") != NULL) + { + char temp_file_temp[SS_MAXPATHLEN] = "\0"; + strncpy(temp_file_temp, ds_name, strlen(ds_name) - 4); + sprintf(new_file_temp, "%s.pdf", temp_file_temp); + sprintf(ds_name, "%s.pdf", temp_file_temp); + } + else + { + sprintf(new_file_temp, "%s.pdf", ds_name); + sprintf(ds_name, "%s.pdf", ds_name); + } + + importPdf2(item_rev_tag, rel_tag, temp_file2, ds_name, new_file_temp, owner_user); + remove(temp_file); + remove(temp_file2); + break; + } + } + } +} + +void importPdf2(tag_t rev_tag, tag_t rel_tag, const char* pdfFile, char* datasetName, char* pdfName, tag_t owner_user) { + printf("---ʼִimportPdf2---\n"); + tag_t* rfTags, datasetTag = NULLTAG, relation = NULLTAG; + int ifail = ITK_ok, rfCount = 0; + char type_class[WSO_object_type_size_c + 1], *pdfDatasetName; + if (datasetTag == NULLTAG) + { + printf("ûҵPDFݼ%sʼд\n", datasetName); + tag_t pdfTypeTag = NULLTAG, tool = NULLTAG; + ITKCALL(AE_find_datasettype2("PDF", &pdfTypeTag)); + ITKCALL(AE_create_dataset_with_id(pdfTypeTag, datasetName, "", "", "A", &datasetTag)); + ITKCALL(AE_ask_datasettype_def_tool(pdfTypeTag, &tool)); + ITKCALL(AE_set_dataset_tool(datasetTag, tool)); + ITKCALL(AE_set_dataset_format2(datasetTag, "PDF_Reference")); + ITKCALL(POM_set_owning_user(datasetTag, owner_user)); + ITKCALL(AOM_save(datasetTag)); + if (datasetTag == NULLTAG) { + return; + } + else + { + ITKCALL(GRM_create_relation(rev_tag, datasetTag, rel_tag, NULLTAG, &relation)); + ITKCALL(GRM_save_relation(relation)); + } + } + + char* pdfFile2 = new char[255]; + strcpy(pdfFile2, pdfFile); + import_dataset_file(datasetTag, "PDF_Reference", "pdf", pdfFile2, pdfName); +} + +void import_dataset_file(tag_t dataset, char* ref_name, char* ext, char* fullfilename, char* original_name) +{ + printf("---ʼִimport_dataset_file---\n"); + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + ITKCALL(AOM_refresh(dataset, FALSE)); + + char new_ds_name[WSO_name_size_c + 1] = ""; + char *filename = strrchr(fullfilename, '\\') + 1; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + if (filename == NULL) + { + return; + } + + POM_AM__set_application_bypass(true); + ITKCALL(IMF_import_file(fullfilename, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + ITKCALL(IMF_set_original_file_name2(new_file_tag, original_name)); + ITKCALL(IMF_close_file(file_descriptor)); + ITKCALL(AOM_save(new_file_tag)); + ITKCALL(AOM_unlock(new_file_tag)); + ITKCALL(AOM_refresh(new_file_tag, FALSE)); + + ITKCALL(AOM_lock(dataset)); + ITKCALL(AE_remove_dataset_named_ref2(dataset, ref_name)); + ITKCALL(AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + ITKCALL(AOM_save(dataset)); + ITKCALL(AOM_unlock(dataset)); + ITKCALL(AOM_refresh(dataset, FALSE)); + POM_AM__set_application_bypass(false); +} + + +void singoff_picture_date(tag_t item_rev_tag, tag_t dataset, tag_t rel_tag, char* ref_name, char* ext, char* jar_name, char* dat_file, char* date, string method, string isSignDate) +{ + printf("------> singoff_picture_date start......\n"); + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG, owner_user = NULLTAG; + char* ds_name = NULL; + AE_reference_type_t reference_type; + + ITKCALL(AOM_ask_owner(dataset, &owner_user)); + ITKCALL(AOM_ask_value_string(dataset, "object_name", &ds_name)); + ITKCALL(AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object)); + + if (reference_type == AE_PART_OF) + { + char* pathname = NULL; + char* origin_file_name = NULL; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + + char new_ds_name2[WSO_name_size_c + 1] = ""; + char* new_file_name2 = USER_new_file_name(new_ds_name2, ref_name, ext, 0); + string newName = new_file_name2; + if (newName.find(".PDF") == string::npos && newName.find(".pdf") == string::npos) + { + strcat(new_file_name2, ".PDF"); + } + printf("new_file_name: %s\n", new_file_name2); + + char* temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN + 1] = ""; + char temp_file2[SS_MAXPATHLEN + 1] = ""; + strcpy_s(temp_file, strlen(temp_file) + strlen(temp_dir) + 1, temp_dir); + strcat_s(temp_file, strlen(temp_file) + strlen("\\") + 1, "\\"); + strcat_s(temp_file, strlen(temp_file) + strlen(new_file_name2) + 1, new_file_name2); + if (_access(temp_file, 0) != -1) + { + remove(temp_file); + } + printf("temp_file = %s\n", temp_file); + IMF_export_file(ref_object, temp_file); + + char cmd[512] = ""; + char* tc_root_dir = nullptr; + size_t s2 = 0; + _dupenv_s(&tc_root_dir, &s2, "tc_root"); + // "java -jar " + strcpy_s(cmd, strlen(cmd) + strlen("java -jar ") + 1, "java -jar "); + strcat_s(cmd, strlen(cmd) + strlen(tc_root_dir) + 1, tc_root_dir); + strcat_s(cmd, strlen(cmd) + strlen(jar_name) + 1, jar_name); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(temp_file) + 1, temp_file); + if (strcmp(ref_name, "PDF_Reference") == 0) + { + char out_file_name[128] = ""; + sprintf_s(out_file_name, 128, "%d-%s", 2, new_file_name2); + + char* tc_data_dir = getenv("temp"); + strcpy_s(temp_file2, strlen(temp_file2) + strlen(tc_data_dir) + 1, tc_data_dir); + strcat_s(temp_file2, strlen(temp_file2) + strlen("\\") + 1, "\\"); + strcat_s(temp_file2, strlen(temp_file2) + strlen(out_file_name) + 1, out_file_name); + printf("temp_file2 = %s\n", temp_file2); + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(temp_file2) + 1, temp_file2); + if (_access(temp_file2, 0) != -1) + { + remove(temp_file2); + } + } + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(dat_file) + 1, dat_file); + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(date) + 1, date); + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(method.c_str()) + 1, method.c_str()); + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(isSignDate.c_str()) + 1, isSignDate.c_str()); + printf("%s\n", cmd); + system(cmd); + + char new_ds_name[WSO_name_size_c + 1] = ""; + char* filename = strrchr(temp_file, '\\') + 1; + char* new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + + POM_AM__set_application_bypass(true); + if (strcmp(ref_name, "PDF_Reference") == 0) + { + ITKCALL(IMF_import_file(temp_file2, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + } + else + { + ITKCALL(IMF_import_file(temp_file, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + } + + string newDsName = ds_name; + if (newDsName.find(".PDF") == string::npos && newDsName.find(".pdf") == string::npos) + { + strcat(ds_name, ".PDF"); + } + char fileName[128] = ""; + if (newDsName.find("/") != string::npos) + { + string prefix = newDsName.substr(0, newDsName.find("/")); + string suffix = newDsName.substr(newDsName.find("/") + 1); + strcpy(fileName, prefix.c_str()); + strcat(fileName, "_"); + strcat(fileName, suffix.c_str()); + } + else + { + strcpy(fileName, ds_name); + } + ITKCALL(IMF_set_original_file_name2(new_file_tag, fileName)); + ITKCALL(IMF_close_file(file_descriptor)); + ITKCALL(AOM_save(new_file_tag)); + ITKCALL(AOM_unlock(new_file_tag)); + ITKCALL(AOM_refresh(new_file_tag, FALSE)); + + ITKCALL(AOM_lock(dataset)); + ITKCALL(AE_remove_dataset_named_ref2(dataset, ref_name)); + ITKCALL(AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + ITKCALL(AOM_save(dataset)); + ITKCALL(AOM_unlock(dataset)); + ITKCALL(AOM_refresh(dataset, FALSE)); + + remove(temp_file); + if (strcmp(ref_name, "PDF_Reference") == 0) + { + remove(temp_file2); + } + printf("ݼ· = %s\n", temp_file); + POM_AM__set_application_bypass(false); + + } +} + + + +int SB_controlled_Lao(EPM_action_message_t msg) +{ + printf("SB_controlled_Lao start......\n"); + int ifail = ITK_ok, args_num = 0, sub_task_cnt = 0, attachments_cnt = 0, pref_cnt=0; + tag_t root_task, *sub_tasks, *attachments; + char *task_name; + + ITKCALL(EPM_ask_root_task(msg.task, &root_task)); + ITKCALL(WSOM_ask_name2(msg.task, &task_name)); + ITKCALL(EPM_ask_sub_tasks(root_task, &sub_task_cnt, &sub_tasks)); + ITKCALL(EPM_ask_attachments(root_task, EPM_target_attachment, &attachments_cnt, &attachments)); + args_num = TC_number_of_arguments(msg.arguments); + if (attachments_cnt < 0 || args_num < 1) + { + return ifail; + } + char *args_value, *para_name, *para_value; + TC_init_argument_list(msg.arguments); + args_value = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value(args_value, ¶_name, ¶_value)); + if (tc_strcmp(para_name, "UID") != 0) + { + return ifail; + } + + char** referList; + int num; + PREF_ask_char_values("SB6_controlled_Date", &num, &referList); + string method = ""; + string isSignDate = ""; + printf("ǰõUID: %s\n", para_value); + for (int i = 0; i < num; i++) + { + std::vector dateVector; + getVector(referList[i], dateVector, '='); + printf("====%s\n", dateVector[0]); + if (dateVector.size() == 3 && tc_strcmp(dateVector[0].c_str(),para_value)== 0) { + method = dateVector[1]; + isSignDate = dateVector[2]; + break; + } + } + if (method.empty() && isSignDate.empty()) { + printf("SB6_controlled_Date not found\n"); + return ifail; + } + + tag_t dataset = NULLTAG,spec_dataset_rev = NULLTAG, ref_object = NULLTAG, owner_user = NULLTAG; + char *ds_name = NULL; + AE_reference_type_t reference_type; + ITK__convert_uid_to_tag(para_value, &dataset); + ITKCALL(AOM_ask_owner(dataset, &owner_user)); + ITKCALL(AOM_ask_value_string(dataset, "object_name", &ds_name)); + ITKCALL(AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, "Image", &reference_type, &ref_object)); + + char* temp_dir = getenv("temp"); + char pitcure_file[SS_MAXPATHLEN + 1] = ""; + strcpy_s(pitcure_file, strlen(pitcure_file) + strlen(temp_dir) + 1, temp_dir); + strcat_s(pitcure_file, strlen(pitcure_file) + strlen("\\") + 1, "\\"); + strcat_s(pitcure_file, strlen(pitcure_file) + strlen(ds_name) + 1, ds_name); + if (_access(pitcure_file, 0) != -1) + { + remove(pitcure_file); + } + ITKCALL(IMF_export_file(ref_object, pitcure_file)); + printf("ͼƬ = %s\n", pitcure_file); + + char *dir = NULL; + char content[256] = "", buf[64] = "", info_path[256] = ""; + time_t t = NULL; + size_t buffer_cnt = 32; + tm *local; + FILE *fw, *fw2; + + _dupenv_s(&dir, &buffer_cnt, "temp"); + local = new tm(); + t = time(NULL); + localtime_s(local, &t); + strftime(buf, 64, "%Y-%m-%d-%H-%M-%S.dat", local); + + if (dir[strlen(dir) - 1] == '\\') + { + sprintf_s(info_path, "%s%s", dir, buf); + } + else + { + sprintf_s(info_path, "%s\\%s", dir, buf); + } + if (_access(info_path, 0) != -1) + { + remove(info_path); + } + if (fopen_s(&fw, info_path, "a+") == 0) + { + //strcat_s(content, strlen(content) + strlen("ܿ=") + 1, "ܿ="); + strcat_s(content, strlen(content) + strlen(task_name) + 1, task_name); + strcat_s(content, strlen(content) + strlen("=") + 1, "="); + strcat_s(content, strlen(content) + strlen(pitcure_file) + 1, pitcure_file); + fwrite(content, sizeof(char), strlen(content), fw); + fclose(fw); + } + if (local != NULL) + { + delete local; + local = NULL; + } + + for (int i = 0; i < attachments_cnt; i++) + { + char *name, *type; + int ds_cnt = 0, ref_cnt = 0, form_cnt =0 ; + tag_t type_tag, relation_type, *ds_tags, *refs, *forms; + + ITKCALL(TCTYPE_ask_object_type(attachments[i], &type_tag)); + ITKCALL(TCTYPE_ask_class_name2(type_tag, &name)); + + if ((strstr(name, "Revision") != NULL) || (strstr(name, "revision") != NULL)) + { + + ITKCALL(AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &form_cnt, &forms)); + date_t date_value; + char* date_str; + ITKCALL(ifail = AOM_ask_value_date(forms[0], "sb6_DRM25", &date_value)); + ITKCALL(ifail = DATE_date_to_string(date_value, "%Y-%m-%d", &date_str)); + printf("--date_str=%s\n", date_str); + + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(GRM_list_secondary_objects_only(attachments[i], relation_type, &ds_cnt, &ds_tags)); + for (int j = 0; j < ds_cnt; j++) + { + ITKCALL(AOM_ask_value_tags(ds_tags[j], "ref_list", &ref_cnt, &refs)); + if (ref_cnt < 1) + { + continue; + } + + tag_t relation_type = NULLTAG; + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(AOM_ask_value_string(ds_tags[j], "object_type", &type)); + if (stricmp(type, "MSWordX") == 0 || stricmp(type, "MSWord") == 0 + || stricmp(type, "MSExcelX") == 0 || stricmp(type, "MSExcel") == 0 + || stricmp(type, "PDF") == 0) + { + if (strcmp(type, "MSWordX") == 0) + { + printf("--MSWordX--\n"); + singoff_picture(attachments[i], ds_tags[j], relation_type, "word", ".docx", "\\bin\\SBControlled\\SubstMacros-MSWord.wsf ", info_path); + } + else if (strcmp(type, "MSWord") == 0) + { + printf("--MSWord--\n"); + singoff_picture(attachments[i], ds_tags[j], relation_type, "word", ".doc", "\\bin\\SBControlled\\SubstMacros-MSWord.wsf", info_path); + } + else if (strcmp(type, "MSExcelX") == 0) + { + printf("--MSExcelX--\n"); + singoff_picture(attachments[i], ds_tags[j], relation_type, "excel", ".xlsx", "\\bin\\SBControlled\\SubstMacros-MSExcel.wsf ", info_path); + } + else if (strcmp(type, "MSExcel") == 0) + { + printf("--MSExcel--\n"); + singoff_picture(attachments[i], ds_tags[j], relation_type, "excel", ".xls", "\\bin\\SBControlled\\SubstMacros-MSExcel.wsf ", info_path); + } + else if (strcmp(type, "PDF") == 0) + { + printf("--PDF--\n"); + singoff_picture_date(attachments[i], ds_tags[j], relation_type, "PDF_Reference", ".pdf", "\\bin\\SignLaoImage.jar ", info_path, date_str, method, isSignDate); + } + } + + if (refs) { MEM_free(refs); type = NULL; } + if (type) { MEM_free(type); type = NULL; } + + } + } + } + + remove(pitcure_file); + remove(info_path); + printf("SB_controlled_Lao end......\n"); + return ifail; +} + + +int SB_controlled_Xin(EPM_action_message_t msg) +{ + printf("SB_controlled_Xin start......\n"); + int ifail = ITK_ok, args_num = 0, sub_task_cnt = 0, attachments_cnt = 0, pref_cnt = 0; + tag_t root_task, *sub_tasks, *attachments; + + ITKCALL(EPM_ask_root_task(msg.task, &root_task)); + ITKCALL(EPM_ask_sub_tasks(root_task, &sub_task_cnt, &sub_tasks)); + ITKCALL(EPM_ask_attachments(root_task, EPM_target_attachment, &attachments_cnt, &attachments)); + args_num = TC_number_of_arguments(msg.arguments); + if (attachments_cnt < 0 || args_num < 1) + { + return ifail; + } + char *args_value, *para_name, *para_value; + TC_init_argument_list(msg.arguments); + args_value = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value(args_value, ¶_name, ¶_value)); + if (tc_strcmp(para_name, "UID") != 0) + { + return ifail; + } + + char** referList; + int num; + PREF_ask_char_values("SB6_controlled_Date", &num, &referList); + string method = ""; + string isSignDate = ""; + for (int i = 0; i < num; i++) + { + std::vector dateVector; + getVector(referList[i], dateVector, '='); + if (dateVector.size() == 3 && dateVector[0] == para_value) { + method = dateVector[1]; + isSignDate = dateVector[2]; + break; + } + } + + tag_t dataset = NULLTAG, spec_dataset_rev = NULLTAG, ref_object = NULLTAG, owner_user = NULLTAG; + char *ds_name = NULL; + AE_reference_type_t reference_type; + ITK__convert_uid_to_tag(para_value, &dataset); + ITKCALL(AOM_ask_owner(dataset, &owner_user)); + ITKCALL(AOM_ask_value_string(dataset, "object_name", &ds_name)); + ITKCALL(AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, "Image", &reference_type, &ref_object)); + + char* temp_dir = getenv("temp"); + char pitcure_file[SS_MAXPATHLEN + 1] = ""; + strcpy_s(pitcure_file, strlen(pitcure_file) + strlen(temp_dir) + 1, temp_dir); + strcat_s(pitcure_file, strlen(pitcure_file) + strlen("\\") + 1, "\\"); + strcat_s(pitcure_file, strlen(pitcure_file) + strlen(ds_name) + 1, ds_name); + if (_access(pitcure_file, 0) != -1) + { + remove(pitcure_file); + } + ITKCALL(IMF_export_file(ref_object, pitcure_file)); + printf("ͼƬ = %s\n", pitcure_file); + + char *dir = NULL; + char content[256] = "", buf[64] = "", info_path[256] = ""; + time_t t = NULL; + size_t buffer_cnt = 32; + tm *local; + FILE *fw, *fw2; + + _dupenv_s(&dir, &buffer_cnt, "temp"); + local = new tm(); + t = time(NULL); + localtime_s(local, &t); + strftime(buf, 64, "%Y-%m-%d-%H-%M-%S.dat", local); + + if (dir[strlen(dir) - 1] == '\\') + { + sprintf_s(info_path, "%s%s", dir, buf); + } + else + { + sprintf_s(info_path, "%s\\%s", dir, buf); + } + if (_access(info_path, 0) != -1) + { + remove(info_path); + } + if (fopen_s(&fw, info_path, "a+") == 0) + { + strcat_s(content, strlen(content) + strlen("ܿ=") + 1, "ܿ="); + strcat_s(content, strlen(content) + strlen(pitcure_file) + 1, pitcure_file); + fwrite(content, sizeof(char), strlen(content), fw); + fclose(fw); + } + if (local != NULL) + { + delete local; + local = NULL; + } + + for (int i = 0; i < attachments_cnt; i++) + { + char *name, *type; + int ds_cnt = 0, ref_cnt = 0,form_cnt = 0; + tag_t type_tag, relation_type, *ds_tags, *refs, * forms; + + ITKCALL(TCTYPE_ask_object_type(attachments[i], &type_tag)); + ITKCALL(TCTYPE_ask_class_name2(type_tag, &name)); + + if ((strstr(name, "Revision") != NULL) || (strstr(name, "revision") != NULL)) + { + + ITKCALL(AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &form_cnt, &forms)); + date_t date_value; + char* date_str; + ITKCALL(ifail = AOM_ask_value_date(forms[0], "sb6_DRM25", &date_value)); + ITKCALL(ifail = DATE_date_to_string(date_value, "%Y-%m-%d", &date_str)); + printf("--date_str=%s\n", date_str); + + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(GRM_list_secondary_objects_only(attachments[i], relation_type, &ds_cnt, &ds_tags)); + for (int j = 0; j < ds_cnt; j++) + { + ITKCALL(AOM_ask_value_tags(ds_tags[j], "ref_list", &ref_cnt, &refs)); + if (ref_cnt < 1) + { + continue; + } + + tag_t relation_type = NULLTAG; + ITKCALL(GRM_find_relation_type(TC_specification_rtype, &relation_type)); + ITKCALL(AOM_ask_value_string(ds_tags[j], "object_type", &type)); + if (stricmp(type, "MSWordX") == 0 || stricmp(type, "MSWord") == 0 + || stricmp(type, "MSExcelX") == 0 || stricmp(type, "MSExcel") == 0 + || stricmp(type, "PDF") == 0) + { + if (strcmp(type, "MSWordX") == 0) + { + printf("--MSWordX--\n"); + singoff_picture(attachments[i], ds_tags[j], relation_type, "word", ".docx", "\\bin\\SBControlled\\SubstMacros-MSWord.wsf ", info_path); + } + else if (strcmp(type, "MSWord") == 0) + { + singoff_picture(attachments[i], ds_tags[j], relation_type, "word", ".doc", "\\bin\\SBControlled\\SubstMacros-MSWord.wsf", info_path); + } + else if (strcmp(type, "MSExcelX") == 0) + { + printf("--MSExcelX--\n"); + singoff_picture(attachments[i], ds_tags[j], relation_type, "excel", ".xlsx", "\\bin\\SBControlled\\SubstMacros-MSExcel.wsf ", info_path); + } + else if (strcmp(type, "MSExcel") == 0) + { + singoff_picture(attachments[i], ds_tags[j], relation_type, "excel", ".xls", "\\bin\\SBControlled\\SubstMacros-MSExcel.wsf ", info_path); + } + else if (strcmp(type, "PDF") == 0) + { + singoff_picture_date(attachments[i], ds_tags[j], relation_type, "PDF_Reference", ".pdf", "\\bin\\SignXinImage.jar ", info_path, date_str,method,isSignDate); + } + } + + if (refs) { MEM_free(refs); type = NULL; } + if (type) { MEM_free(type); type = NULL; } + + } + } + } + + remove(pitcure_file); + remove(info_path); + printf("SB_controlled_Xin end......\n"); + return ifail; +} + +void singoff_picture(tag_t item_rev_tag, tag_t dataset, tag_t rel_tag, char *ref_name, char *ext, char *jar_name, char *dat_file) +{ + printf("singoff_picture start......\n"); + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG, owner_user = NULLTAG; + char *ds_name = NULL; + AE_reference_type_t reference_type; + + ITKCALL(AOM_ask_owner(dataset, &owner_user)); + ITKCALL(AOM_ask_value_string(dataset, "object_name", &ds_name)); + ITKCALL(AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev)); + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object)); + + if (reference_type == AE_PART_OF) + { + char *pathname = NULL; + char *origin_file_name = NULL; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + + char new_ds_name2[WSO_name_size_c + 1] = ""; + char *new_file_name2 = USER_new_file_name(new_ds_name2, ref_name, ext, 0); + string newName = new_file_name2; + if (newName.find(".PDF") == string::npos && newName.find(".pdf") == string::npos) + { + strcat(new_file_name2, ".PDF"); + } + printf("new_file_name: %s\n", new_file_name2); + + char* temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN + 1] = ""; + char temp_file2[SS_MAXPATHLEN + 1] = ""; + strcpy_s(temp_file, strlen(temp_file) + strlen(temp_dir) + 1, temp_dir); + strcat_s(temp_file, strlen(temp_file) + strlen("\\") + 1, "\\"); + strcat_s(temp_file, strlen(temp_file) + strlen(new_file_name2) + 1, new_file_name2); + if (_access(temp_file, 0) != -1) + { + remove(temp_file); + } + printf("temp_file = %s\n", temp_file); + IMF_export_file(ref_object, temp_file); + + char cmd[512] = ""; + char *tc_root_dir = nullptr; + size_t s2 = 0; + _dupenv_s(&tc_root_dir, &s2, "tc_root"); + strcat_s(cmd, strlen(cmd) + strlen(tc_root_dir) + 1, tc_root_dir); + strcat_s(cmd, strlen(cmd) + strlen(jar_name) + 1, jar_name); + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(temp_file) + 1, temp_file); + if (strcmp(ref_name, "PDF_Reference") == 0) + { + char out_file_name[128] = ""; + sprintf_s(out_file_name, 128, "%d-%s", 2, new_file_name2); + + char *tc_data_dir = getenv("temp"); + strcpy_s(temp_file2, strlen(temp_file2) + strlen(tc_data_dir) + 1, tc_data_dir); + strcat_s(temp_file2, strlen(temp_file2) + strlen("\\") + 1, "\\"); + strcat_s(temp_file2, strlen(temp_file2) + strlen(out_file_name) + 1, out_file_name); + printf("temp_file2 = %s\n", temp_file2); + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(temp_file2) + 1, temp_file2); + if (_access(temp_file2, 0) != -1) + { + remove(temp_file2); + } + } + + strcat_s(cmd, strlen(cmd) + strlen(" ") + 1, " "); + strcat_s(cmd, strlen(cmd) + strlen(dat_file) + 1, dat_file); + printf("%s\n",cmd); + system(cmd); + + char new_ds_name[WSO_name_size_c + 1] = ""; + char *filename = strrchr(temp_file, '\\') + 1; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + + POM_AM__set_application_bypass(true); + if (strcmp(ref_name, "PDF_Reference") == 0) + { + ITKCALL(IMF_import_file(temp_file2, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + } + else + { + ITKCALL(IMF_import_file(temp_file, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + } + + string newDsName = ds_name; + if (newDsName.find(".PDF") == string::npos && newDsName.find(".pdf") == string::npos) + { + strcat(ds_name, ".PDF"); + } + char fileName[128] = ""; + if (newDsName.find("/") != string::npos) + { + string prefix = newDsName.substr(0, newDsName.find("/")); + string suffix = newDsName.substr(newDsName.find("/") + 1); + strcpy(fileName, prefix.c_str()); + strcat(fileName, "_"); + strcat(fileName, suffix.c_str()); + } + else + { + strcpy(fileName, ds_name); + } + ITKCALL(IMF_set_original_file_name2(new_file_tag, fileName)); + ITKCALL(IMF_close_file(file_descriptor)); + ITKCALL(AOM_save(new_file_tag)); + ITKCALL(AOM_unlock(new_file_tag)); + ITKCALL(AOM_refresh(new_file_tag, FALSE)); + + ITKCALL(AOM_lock(dataset)); + ITKCALL(AE_remove_dataset_named_ref2(dataset, ref_name)); + ITKCALL(AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + ITKCALL(AOM_save(dataset)); + ITKCALL(AOM_unlock(dataset)); + ITKCALL(AOM_refresh(dataset, FALSE)); + + remove(temp_file); + if (strcmp(ref_name, "PDF_Reference") == 0) + { + remove(temp_file2); + } + printf("ݼ· = %s\n",temp_file); + POM_AM__set_application_bypass(false); + + } +} diff --git a/SB/SB_handler.h b/SB/SB_handler.h new file mode 100644 index 0000000..439c4ec --- /dev/null +++ b/SB/SB_handler.h @@ -0,0 +1,84 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +extern "C" int POM_AM__set_application_bypass(logical bypass); + + +int Lao(EPM_action_message_t msg); +int Lao_excute_pdf(tag_t dateset, char *file_path, char *file_name, char* ext); +int Xin(EPM_action_message_t msg); +int Xin_excute_pdf(tag_t dateset, char *file_path, char *file_name, char* ext); + +int convertToPDF(EPM_action_message_t msg); +void startConversion(tag_t item_rev_tag, tag_t dataset, tag_t rel_tag, char *ref_name, char *ext, char *jar_name); +void importPdf2(tag_t rev_tag, tag_t rel_tag, const char* pdfFile, char* datasetName, char* pdfName, tag_t owner_user); +void import_dataset_file(tag_t dataset, char* ref_name, char* ext, char* fullfilename, char* original_name); + +int SB_controlled_Lao(EPM_action_message_t msg); +int SB_controlled_Xin(EPM_action_message_t msg); +int SB6_PR_AutoAssign(EPM_action_message_t msg); +int Origin_CheckTask_handler2(EPM_rule_message_t msg); +void singoff_picture(tag_t item_rev_tag, tag_t dataset, tag_t rel_tag, char *ref_name, char *ext, char *jar_name, char *dat_file); +void getVector(const char* value, std::vector& targetVector, char delimiter); \ No newline at end of file diff --git a/SB/stdafx.cpp b/SB/stdafx.cpp new file mode 100644 index 0000000..decd972 --- /dev/null +++ b/SB/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// SB.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H κĸͷļ +//ڴļ diff --git a/SB/stdafx.h b/SB/stdafx.h new file mode 100644 index 0000000..baa4bbc --- /dev/null +++ b/SB/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/SB/string_helper.cpp b/SB/string_helper.cpp new file mode 100644 index 0000000..31dbeeb --- /dev/null +++ b/SB/string_helper.cpp @@ -0,0 +1,96 @@ +/** +* @file string_helper.cpp +* @brief string utility functions' implemention +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +* 14-Jau-2009 James modify Split functions, add trim blank characters +*/ +#pragma warning(disable:4996) +#include "string_helper.h" + +string TrimString(string strArg) +{ + size_t index1 = 0; + index1 = strArg.find_first_not_of(' '); + if (index1 != string::npos) + strArg.erase(strArg.begin(), strArg.begin() + index1); + index1 = strArg.find_last_not_of(' '); + if (index1 != string::npos) + strArg.erase(strArg.begin() + index1 + 1); + return strArg; +} + +void Split(string strArg, char spliter, vector& ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find_first_of(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} + +void Split(string strArg, string spliter, vector& ans) +{ + + ans.clear(); + + size_t index0; + string one_arg; + + if (strArg.find_first_not_of(" ") == string::npos) + strArg = ""; + + + 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); +} + diff --git a/SB/string_helper.h b/SB/string_helper.h new file mode 100644 index 0000000..014c8d0 --- /dev/null +++ b/SB/string_helper.h @@ -0,0 +1,21 @@ +/** +* @file string_helper.h +* @brief string utilities to help dealing with string +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 James +*/ + +#ifndef STRING_HELPER +#define STRING_HELPER +#include +#include +using namespace std; +string TrimString(string strArg); +void Split(string strArg, char spliter, vector& ans); +void Split(string strArg, string spliter, vector& ans); +void RemoveLiner(string& in, string& out); + +#endif \ No newline at end of file diff --git a/SB/targetver.h b/SB/targetver.h new file mode 100644 index 0000000..416cebf --- /dev/null +++ b/SB/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// _WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/SB/x64/Release/Main_lib.obj b/SB/x64/Release/Main_lib.obj new file mode 100644 index 0000000..b984edb Binary files /dev/null and b/SB/x64/Release/Main_lib.obj differ diff --git a/SB/x64/Release/Register_handler.obj b/SB/x64/Release/Register_handler.obj new file mode 100644 index 0000000..c357e29 Binary files /dev/null and b/SB/x64/Release/Register_handler.obj differ diff --git a/SB/x64/Release/SB.Build.CppClean.log b/SB/x64/Release/SB.Build.CppClean.log new file mode 100644 index 0000000..0413534 --- /dev/null +++ b/SB/x64/Release/SB.Build.CppClean.log @@ -0,0 +1,21 @@ +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\vc142.pdb +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\string_helper.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\stdafx.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb_handler.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb6_pr_autoassign.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\register_handler.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\main_lib.obj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\x64\release\sb.dll +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.ipdb +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.iobj +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\x64\release\sb.pdb +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\x64\release\sb.lib +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\x64\release\sb.exp +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\cl.command.1.tlog +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\cl.read.1.tlog +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\cl.write.1.tlog +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\link.command.1.tlog +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\link.read.1.tlog +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\link.write.1.tlog +e:\itk_workspace\itk\世宝\杭州世宝\sb\sb\sb\x64\release\sb.tlog\sb.write.1u.tlog diff --git a/SB/x64/Release/SB.dll.recipe b/SB/x64/Release/SB.dll.recipe new file mode 100644 index 0000000..07af3f9 --- /dev/null +++ b/SB/x64/Release/SB.dll.recipe @@ -0,0 +1,11 @@ + + + + + E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\x64\Release\SB.dll + + + + + + \ No newline at end of file diff --git a/SB/x64/Release/SB.iobj b/SB/x64/Release/SB.iobj new file mode 100644 index 0000000..b3b57d2 Binary files /dev/null and b/SB/x64/Release/SB.iobj differ diff --git a/SB/x64/Release/SB.ipdb b/SB/x64/Release/SB.ipdb new file mode 100644 index 0000000..2865313 Binary files /dev/null and b/SB/x64/Release/SB.ipdb differ diff --git a/SB/x64/Release/SB.log b/SB/x64/Release/SB.log new file mode 100644 index 0000000..66f82ea --- /dev/null +++ b/SB/x64/Release/SB.log @@ -0,0 +1,137 @@ + Main_lib.cpp +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + Register_handler.cpp +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: “Teamcenter::RootObject::m_typeName”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: “Teamcenter::RootObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: “Teamcenter::OperationInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::OperationInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: “Teamcenter::BulkInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: “Teamcenter::BulkData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkData”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: “Teamcenter::CreateInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::CreateInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: “Teamcenter::SaveAsInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::SaveAsInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: “Teamcenter::DeepCopyData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::DeepCopyData”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: “Teamcenter::BusinessObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BusinessObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: “Teamcenter::POM_object::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::POM_object”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\property\PropertyInfo.hxx(131,25): warning C4251: “Teamcenter::PropertyInfo::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::PropertyInfo”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 + SB.cpp + SB6_PR_AutoAssign.cpp +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: “Teamcenter::RootObject::m_typeName”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: “Teamcenter::RootObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: “Teamcenter::OperationInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::OperationInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: “Teamcenter::BulkInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: “Teamcenter::BulkData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkData”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: “Teamcenter::CreateInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::CreateInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: “Teamcenter::SaveAsInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::SaveAsInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: “Teamcenter::DeepCopyData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::DeepCopyData”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: “Teamcenter::BusinessObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BusinessObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: “Teamcenter::POM_object::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::POM_object”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\property\PropertyInfo.hxx(131,25): warning C4251: “Teamcenter::PropertyInfo::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::PropertyInfo”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(45,31): warning C4101: “old_scope”: 未引用的局部变量 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(138,34): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(156,30): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(183,12): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“const std::basic_string,std::allocator>” +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(198,12): warning C4477: “printf”: 格式字符串“%d”需要类型“int”的参数,但可变参数 1 拥有了类型“unsigned __int64” +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(198,12): message : 请考虑在格式字符串中使用“%zd” +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(201,13): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“const _Ty” + with + [ + _Ty=std::string + ] +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(201,13): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 2 拥有了类型“_Ty” + with + [ + _Ty=std::string + ] +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(234,11): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“std::string” +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB6_PR_AutoAssign.cpp(184,5): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + SB_handler.cpp +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\RootObject.hxx(90,17): warning C4251: “Teamcenter::RootObject::m_typeName”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\RootObject.hxx(95,24): warning C4251: “Teamcenter::RootObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\OperationInput.hxx(414,25): warning C4251: “Teamcenter::OperationInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::OperationInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BulkInput.hxx(120,25): warning C4251: “Teamcenter::BulkInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BulkData.hxx(123,25): warning C4251: “Teamcenter::BulkData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkData”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\CreateInput.hxx(140,25): warning C4251: “Teamcenter::CreateInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::CreateInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\SaveAsInput.hxx(93,25): warning C4251: “Teamcenter::SaveAsInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::SaveAsInput”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\DeepCopyData.hxx(93,25): warning C4251: “Teamcenter::DeepCopyData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::DeepCopyData”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\metaframework\BusinessObject.hxx(666,25): warning C4251: “Teamcenter::BusinessObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BusinessObject”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\tccore\POM_object.hxx(253,25): warning C4251: “Teamcenter::POM_object::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::POM_object”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +C:\environment\Teamcenter-ENV\ITK_Configuration_File\LiYuan\include_cpp\property\PropertyInfo.hxx(131,25): warning C4251: “Teamcenter::PropertyInfo::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::PropertyInfo”的客户端使用 +D:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string,std::allocator>”的声明 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(262,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(268,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(490,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(496,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(694,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(683,7): warning C4101: “type_class”: 未引用的局部变量 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(681,9): warning C4101: “rfTags”: 未引用的局部变量 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(683,48): warning C4101: “pdfDatasetName”: 未引用的局部变量 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(729,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(736,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(863,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(870,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(922,10): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“_Ty” + with + [ + _Ty=std::string + ] +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1011,4): warning C4476: "printf": 格式说明符中的类型字段字符“Y”未知 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1011,4): warning C4476: "printf": 格式说明符中的类型字段字符“m”未知 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1011,4): warning C4473: “printf”: 没有为格式字符串传递足够的参数 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1011,4): message : 占位符和其参数预计 1 可变参数,但提供的却是 0 参数 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1011,4): message : 缺失的可变参数 1 为格式字符串“%d”所需 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(960,13): warning C4101: “fw2”: 未引用的局部变量 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1186,4): warning C4476: "printf": 格式说明符中的类型字段字符“Y”未知 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1186,4): warning C4476: "printf": 格式说明符中的类型字段字符“m”未知 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1186,4): warning C4473: “printf”: 没有为格式字符串传递足够的参数 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1186,4): message : 占位符和其参数预计 1 可变参数,但提供的却是 0 参数 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1186,4): message : 缺失的可变参数 1 为格式字符串“%d”所需 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1137,13): warning C4101: “fw2”: 未引用的局部变量 +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1352,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(1359,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. + stdafx.cpp + string_helper.cpp + 正在创建库 E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\x64\Release\SB.lib 和对象 E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\x64\Release\SB.exp + 正在生成代码 + Previous IPDB not found, fall back to full compilation. +E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\SB\SB_handler.cpp(569): warning C4715: “convertToPDF”: 不是所有的控件路径都返回值 + All 401 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. + 已完成代码的生成 + SB.vcxproj -> E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\x64\Release\SB.dll diff --git a/SB/x64/Release/SB.obj b/SB/x64/Release/SB.obj new file mode 100644 index 0000000..f36c4b4 Binary files /dev/null and b/SB/x64/Release/SB.obj differ diff --git a/SB/x64/Release/SB.tlog/CL.command.1.tlog b/SB/x64/Release/SB.tlog/CL.command.1.tlog new file mode 100644 index 0000000..89f1250 Binary files /dev/null and b/SB/x64/Release/SB.tlog/CL.command.1.tlog differ diff --git a/SB/x64/Release/SB.tlog/CL.read.1.tlog b/SB/x64/Release/SB.tlog/CL.read.1.tlog new file mode 100644 index 0000000..6d61b61 Binary files /dev/null and b/SB/x64/Release/SB.tlog/CL.read.1.tlog differ diff --git a/SB/x64/Release/SB.tlog/CL.write.1.tlog b/SB/x64/Release/SB.tlog/CL.write.1.tlog new file mode 100644 index 0000000..a244c71 Binary files /dev/null and b/SB/x64/Release/SB.tlog/CL.write.1.tlog differ diff --git a/SB/x64/Release/SB.tlog/SB.lastbuildstate b/SB/x64/Release/SB.tlog/SB.lastbuildstate new file mode 100644 index 0000000..7a4c368 --- /dev/null +++ b/SB/x64/Release/SB.tlog/SB.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Release|x64|E:\ITK_WorkSpace\ITK\世宝\杭州世宝\SB\SB\| diff --git a/SB/x64/Release/SB.tlog/SB.write.1u.tlog b/SB/x64/Release/SB.tlog/SB.write.1u.tlog new file mode 100644 index 0000000..0b00272 Binary files /dev/null and b/SB/x64/Release/SB.tlog/SB.write.1u.tlog differ diff --git a/SB/x64/Release/SB.tlog/link.command.1.tlog b/SB/x64/Release/SB.tlog/link.command.1.tlog new file mode 100644 index 0000000..76433a2 Binary files /dev/null and b/SB/x64/Release/SB.tlog/link.command.1.tlog differ diff --git a/SB/x64/Release/SB.tlog/link.read.1.tlog b/SB/x64/Release/SB.tlog/link.read.1.tlog new file mode 100644 index 0000000..19a99c5 Binary files /dev/null and b/SB/x64/Release/SB.tlog/link.read.1.tlog differ diff --git a/SB/x64/Release/SB.tlog/link.write.1.tlog b/SB/x64/Release/SB.tlog/link.write.1.tlog new file mode 100644 index 0000000..893be00 Binary files /dev/null and b/SB/x64/Release/SB.tlog/link.write.1.tlog differ diff --git a/SB/x64/Release/SB.vcxproj.FileListAbsolute.txt b/SB/x64/Release/SB.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/SB/x64/Release/SB6_PR_AutoAssign.obj b/SB/x64/Release/SB6_PR_AutoAssign.obj new file mode 100644 index 0000000..9956a3d Binary files /dev/null and b/SB/x64/Release/SB6_PR_AutoAssign.obj differ diff --git a/SB/x64/Release/SB_handler.obj b/SB/x64/Release/SB_handler.obj new file mode 100644 index 0000000..659fe4c Binary files /dev/null and b/SB/x64/Release/SB_handler.obj differ diff --git a/SB/x64/Release/stdafx.obj b/SB/x64/Release/stdafx.obj new file mode 100644 index 0000000..21b4891 Binary files /dev/null and b/SB/x64/Release/stdafx.obj differ diff --git a/SB/x64/Release/string_helper.obj b/SB/x64/Release/string_helper.obj new file mode 100644 index 0000000..e01a350 Binary files /dev/null and b/SB/x64/Release/string_helper.obj differ diff --git a/SB/x64/Release/vc142.pdb b/SB/x64/Release/vc142.pdb new file mode 100644 index 0000000..e1fc738 Binary files /dev/null and b/SB/x64/Release/vc142.pdb differ diff --git a/x64/Release/SB.dll b/x64/Release/SB.dll new file mode 100644 index 0000000..d652963 Binary files /dev/null and b/x64/Release/SB.dll differ diff --git a/x64/Release/SB.exp b/x64/Release/SB.exp new file mode 100644 index 0000000..e086c27 Binary files /dev/null and b/x64/Release/SB.exp differ diff --git a/x64/Release/SB.lib b/x64/Release/SB.lib new file mode 100644 index 0000000..81e79f0 Binary files /dev/null and b/x64/Release/SB.lib differ diff --git a/x64/Release/SB.pdb b/x64/Release/SB.pdb new file mode 100644 index 0000000..ae2c9d1 Binary files /dev/null and b/x64/Release/SB.pdb differ