


#ifndef EPM_HANDLER_COMMON
#define EPM_HANDLER_COMMON

#include "tinyxml.h"
#include <string>
#include <xstring>
#include <vector>
#include <map>
#include <ctime>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <res\res_itk.h>
#include <tc\preferences.h>
#include <tc\tc_macros.h>
#include <tc\folder.h>
#include <qry\qry.h>
#include <cfm\cfm.h>
#include <fclasses/tc_date.h>
#include <epm/signoff.h>
#include <schmgt\schmgt_bridge_itk.h>
#include <epm/epm.h>
#include <epm/epm_task_template_itk.h>
#include <ae/ae.h>
#include <ict/ict_userservice.h>
#include <bom/bom.h>
#include <tccore\aom_prop.h>
#include <tccore//grm.h>
#include <tccore/grmtype.h>
#include <tccore\item.h>
#include <tccore/design.h>
#include <tccore/part.h>
#include <tccore\aom.h>
#include <sa/user.h>
#include <ics/ics2.h>
#include <wininet.h>
#include <io.h>
#include "sa/am.h"
#include <chrono>
#include <tccore/project.h>
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")

#pragma comment(lib, "WinInet.lib")

using namespace std; 

	std::vector<std::string> split2(const std::string &str, const std::string &pattern);
#ifdef __cplusplus
extern "C" {
#endif

#define DOFREE(obj);
	extern "C" int POM_AM__set_application_bypass(logical bypass);
	bool create_adhoc_signoff(tag_t current_task, vector<tag_t> userID);
	char * inputFileToFtp(char * filePath);
	char * getLineCode(char * lineCode);
	void removeChar(char* str, char c);
	char* U2G(const char* utf8);
	const char* newGUID();
	void split(char *src, const char *separator, char **dest, int *num);
	void Split(string strArg, string spliter, vector<string> &ans);
	int gbk_strlen(const char* str);
	string replace_all_distinct(char* strC, char*  old_valueC, char*  new_valueC);
	void stringToLenth(int value, int num, char ** result);
	bool count(vector<char *> values, char * value);
	void BOMSendToWeixin(char * userId, tag_t rootTask_tag, string message);
	void itemSendToWeixin(char * userId, tag_t rootTask_tag, string message);
	void TCFindItem(char * queryName, int n_entries, char ** qry_entries, char ** qry_values, int * n_found, tag_t ** dba_mbrs);
	void TCGetPropertyValue(tag_t item, char * type, char * propertyName, char ** propertyValue);
	int ORIGIN_set_bypass(void *returnValue);
	int ORIGIN_close_bypass(void *returnValue);
	int ML_ChildIsRelease(EPM_action_message_t msg);
	int ML_SetProcessNodeOwner(EPM_action_message_t msg);
	int ML_SetScheduleTaskProperty(EPM_action_message_t msg);
	int ML_CreateSumProcess(EPM_action_message_t msg);
	int ML_HaveDataSet(EPM_action_message_t msg);
	void cutScheduleTask(tag_t scheduleTaskTags, tag_t scheduleTags);
	int Cut_ScheduleTask(EPM_action_message_t msg);
	int connor_set_prop_value(void * returnValue);
	int ML_HaveBomLine(EPM_action_message_t msg);
	int ML_AddItemToAttachments(EPM_action_message_t msg);
	int ML_ChangOwning(EPM_action_message_t msg);
	int ML_ItemRevUpdate(METHOD_message_t* msg, va_list args);
	int ML_ItemRevPreUpdate(METHOD_message_t* msg, va_list args);
	int ML_ChangeItemFolder(EPM_action_message_t msg);
	int ML_RemoveFolderItem(EPM_action_message_t msg);
	int ML_ChangeFormProperty(EPM_action_message_t msg);
	int ML_ChangeStatus(EPM_action_message_t msg);
	int ML_AddFormToAttachments(EPM_action_message_t msg);
	int ML_ElevateTask(EPM_action_message_t msg);
	int ML_ReferencedIsHaveItem(EPM_action_message_t msg);
	int ML_ChangeObjectDesc(EPM_action_message_t msg);
	int ML_CheckCharLenthMessage(EPM_action_message_t msg);
	int ML_CheckCharLenth(EPM_action_message_t msg);
	int ML_SendSapItem(EPM_action_message_t msg);
	int ML_SendSapBom(EPM_action_message_t msg);
	int ML_SendSapBom_TCM(EPM_action_message_t msg);
	int ML_Check_Route(EPM_action_message_t msg);
	int ML_ItemIsRelease(EPM_action_message_t msg);
	int ML_AddReleaseItemToAttachments(EPM_action_message_t msg);
	int ML_ItemIsHavePDF(EPM_action_message_t msg);
	int ML_CreateBomView(EPM_action_message_t msg);
	int ML_TCMSendSapBomMonolayer(EPM_action_message_t msg);
	int ML_TCMSendSapItem(EPM_action_message_t msg);
	int ML_TCMSendSapBom(EPM_action_message_t msg);
	int ML_TCMUserSendSapBom(void * returnValue);
	int ML_TCMSendSapCostCollector(EPM_action_message_t msg);
	int ML_TCMUserSendSapCostCollector(void * returnValue);
	int ML_TCMSendMesBom(EPM_action_message_t msg);
	int ML_TCMUserSendMesBom(void * returnValue);
	int ML_TCMSendMesSop(EPM_action_message_t msg);
	int ML_TCMUserSendMesSop(void * returnValue); 
	int ML_TCMSendMesSpecialProcess(EPM_action_message_t msg);
	int ML_TCMUserSendMesSpecialProcess(void * returnValue);
	int ML_TCMSendSapMBom(EPM_action_message_t msg);
	int ML_ChildGeneralIdentify(EPM_action_message_t msg);
	int Judge_attribute(EPM_rule_message_t msg);
	int ML_CheckObjectDesc(EPM_action_message_t msg);
	int ML_ItemChildIsRelease(EPM_action_message_t msg);
	int ML_ItemParentIsRelease(EPM_action_message_t msg);
	int ML_Test(EPM_action_message_t msg);
	logical isVecHasStr(vector<string> vec, char * str);
	char* G2U(const char* gb2312);
	int ML_CheckMBOM(EPM_action_message_t msg);
	int ML_ChideIsEnabled(EPM_action_message_t msg);
	void WriteLog(logical debug, const char* format, ...);
	int ML_TCMSendSrmBom(EPM_action_message_t msg);
	void itemSendToWeixin_srm(char * userId, tag_t rootTask_tag, string message);
	int ML_DesignPartCopy(METHOD_message_t* msg, va_list args);
	//根据选中文件夹所在项目为创建的对象、文件夹自动指派项目
	int ML_Automatic_Assignment_Item(METHOD_message_t* msg, va_list args);
#ifdef __cplusplus
}
#endif

#endif 


/**
* @}
*/