王辰 2 years ago
parent 9d3f4e42d6
commit 7b752b108c

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -137,7 +137,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<OutputFile>$(OutDir)\bs.dll</OutputFile> <OutputFile>$(OutDir)\bs.dll</OutputFile>
<AdditionalOptions>/FORCE %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/FORCE %(AdditionalOptions)</AdditionalOptions>
@ -164,6 +164,7 @@
<ClCompile Include="bs_sign_cad.cpp" /> <ClCompile Include="bs_sign_cad.cpp" />
<ClCompile Include="bs_test_release_check.cpp" /> <ClCompile Include="bs_test_release_check.cpp" />
<ClCompile Include="bs_wl_check.cpp" /> <ClCompile Include="bs_wl_check.cpp" />
<ClCompile Include="check_release_issus.cpp" />
<ClCompile Include="CSendMail.cpp" /> <ClCompile Include="CSendMail.cpp" />
<ClCompile Include="jd_auto_revise.cpp" /> <ClCompile Include="jd_auto_revise.cpp" />
<ClCompile Include="jd_check_99_cglx.cpp" /> <ClCompile Include="jd_check_99_cglx.cpp" />
@ -184,6 +185,7 @@
<ClCompile Include="jd_signoff.cpp" /> <ClCompile Include="jd_signoff.cpp" />
<ClCompile Include="jd_check_wlms_len.cpp" /> <ClCompile Include="jd_check_wlms_len.cpp" />
<ClCompile Include="jd_splicing_task.cpp" /> <ClCompile Include="jd_splicing_task.cpp" />
<ClCompile Include="Sample_confirmation_sheet.cpp" />
<ClCompile Include="util.cpp" /> <ClCompile Include="util.cpp" />
<ClCompile Include="jd_check_ID_wllx.cpp" /> <ClCompile Include="jd_check_ID_wllx.cpp" />
<ClCompile Include="jd_rev_release.cpp" /> <ClCompile Include="jd_rev_release.cpp" />

@ -131,6 +131,12 @@
<ClCompile Include="jd_splicing_task.cpp"> <ClCompile Include="jd_splicing_task.cpp">
<Filter>epm-handler</Filter> <Filter>epm-handler</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="check_release_issus.cpp">
<Filter>epm-handler</Filter>
</ClCompile>
<ClCompile Include="Sample_confirmation_sheet.cpp">
<Filter>epm-handler</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="epm_register_handler.h"> <ClInclude Include="epm_register_handler.h">

@ -0,0 +1,207 @@
#include "util.h"
int setTarget2(tag_t tag_task, tag_t tag_a) {
int ifail = ITK_ok;
int master_count = 0, count = 0;
int attachment_types = 0;
if (tag_a != NULL) {
AOM_unlock(tag_a);
attachment_types = EPM_target_attachment;
printf("开始将版本放入目标\n");
ITKCALL(EPM_add_attachments(tag_task, 1, &(tag_a), &attachment_types));
printf("结束将版本放入目标\n");
return ITK_ok;
}
}
int Sample_confirmation_sheet(EPM_rule_message_t msg) {
POM_AM__set_application_bypass(true);
tag_t root_task, * attachments;
int att_cnt;
//获得根节点
EPM_ask_root_task(msg.task, &root_task);
//获得根任务下的组件
EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments);
//判断参数是否符合要求
char* object_string;
std::string names = "";
int bjNum = 0;
//遍历任务组件 TC_Is_Represented_By
for (int i = 0; i < att_cnt; i++) {
if (isTypeOf(attachments[i], "ItemRevision")) {
int object_att;
tag_t* object;
//得到零组件
AOM_ask_value_tags(attachments[i], "items_tag", &object_att, &object);
if (object_att == 0)
{
continue;
}
char* item_id;
int n_referencers;
int* levels;
tag_t* referencers;
char** relations;
//得到零组件的引用对象
WSOM_where_referenced(object[0], 1, &n_referencers, &levels, &referencers, &relations);
int itemRecision_att;
tag_t* itemRecision;
//得到引用对象的最新版本
AOM_ask_value_tags(referencers[0], "revision_list", &itemRecision_att, &itemRecision);
if (itemRecision_att <= 0) {
EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, "该清单没有关联物料!");
return EPM_nogo;
}
////creation_date
//int dataNum;
//date_t* time;
//int index = 0;
//int prefTime = 0;
//int prefTimeDay = 0;
//int prefTimeHour = 0;
//int prefTimeMinute = 0;
//for (int j = 0; j < itemRecision_att; j++) {
// if (isTypeOf(itemRecision[j], "ItemRevision")) {
// AOM_ask_value_dates(itemRecision[j], "creation_date", &dataNum, &time);
// int createTime = time->year + time->month;
// if (createTime > prefTime) {
// prefTime = createTime;
// prefTimeDay = time->day;
// prefTimeHour = time->hour;
// prefTimeMinute = time->minute;
// index = j;
// }
// if (createTime == prefTime) {
// if (time->day > prefTimeDay) {
// prefTime = createTime;
// prefTimeDay = time->day;
// prefTimeHour = time->hour;
// prefTimeMinute = time->minute;
// index = j;
// }
// if (time->day == prefTimeDay) {
// if (time->hour > prefTimeHour) {
// prefTime = createTime;
// prefTimeDay = time->day;
// prefTimeHour = time->hour;
// prefTimeMinute = time->minute;
// index = j;
// }
// if (time->hour == prefTimeHour) {
// if (time->minute > prefTimeMinute) {
// prefTime = createTime;
// prefTimeDay = time->day;
// prefTimeHour = time->hour;
// prefTimeMinute = time->minute;
// index = j;
// }
// }
// }
// }
// }
//}
//新增物料,判断版本表单是否是待验证状态
if (itemRecision_att == 1) {
int form_att;
tag_t* forms;
AOM_ask_value_tags(itemRecision[0], "IMAN_master_form_rev", &form_att, &forms);
printf("form_att====>%d\n", form_att);
char* object_string;
int fb_att;
tag_t* fb;
AOM_ask_value_tags(forms[0], "release_status_list", &fb_att, &fb);
if (fb_att == 0) {
EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, "物料版本非待验证状态,请先走物料新增审批流程");
return EPM_nogo;
}
AOM_ask_value_string(fb[0], "object_string", &object_string);
printf("object_string====>%s\n", object_string);
if (strcmp(object_string, "待验证") != 0 && strcmp(object_string, "正式") != 0)
{
EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, "物料版本表单状态不是待待验证或正式,不允许发起流程");
return EPM_nogo;
}
}
//已经升版,判断上一版本是否已经发布
//if (itemRecision_att > 1) {
// int dataNum;
// date_t* time;
// AOM_ask_value_dates(itemRecision[index - 1], "date_released", &dataNum, &time);
// cout << "time1->year:" << time->year << endl;
// if (time->year == 0) {
// //没有发布
// EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, "请检查物料版本表单状态");
// return EPM_nogo;
// }
//}
int tz_att;
tag_t* tz;
//得到引用对象的版本关系 TC_Is_Represented_By 找到图纸对象
AOM_ask_value_tags(itemRecision[itemRecision_att-1], "TC_Is_Represented_By", &tz_att, &tz);
if (tz_att < 1) {
//没有图纸 date_released
bjNum = -1;
}
else {
int tzRelease_att;
tag_t* tzRelease;
//获取图纸对象的版本
AOM_ask_value_tags(tz[0], "revision_list", &tzRelease_att, &tzRelease);
int dataNum1;
date_t* time1;
//判断图纸对象的版本是否发布
AOM_ask_value_dates(tzRelease[tzRelease_att - 1], "date_released", &dataNum1, &time1);
printf("1=>\n");
//cout << "time1->year:" << time1->year << endl;
if (time1->year == 0) {
//没有发布
bjNum = -1;
printf("2=>\n");
}
else {
printf("3=>\n");
//将版本进行发布
/*tag_t release_status = NULL;
RELSTAT_create_release_status("TCM Released", &release_status);
RELSTAT_add_release_status(release_status, 1, &itemRecision[index], TRUE);*/
//记得开旁路
tag_t task_tag = NULLTAG,
root_task_tag = NULLTAG;
task_tag = msg.task;
setTarget2(root_task, itemRecision[itemRecision_att-1]);//将版本带入目标
}
}
}
}
if (bjNum == -1) {
char* message = "需要确认图纸存在并已发布!!";
cout << "Exception:" << message << endl;
EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, message);
return EPM_nogo;
}
POM_AM__set_application_bypass(false);
return EPM_go;
}

@ -11,7 +11,7 @@ void judge(tag_t top,string &status,stringstream &ss)
AOM_UIF_ask_value(lines[j], "jd2_last_release_status", &val); AOM_UIF_ask_value(lines[j], "jd2_last_release_status", &val);
printf("status:%s\n", val); printf("status:%s\n", val);
string temp = val; string temp = val;
if (temp.length()>0&&status.find(val) != -1) if (temp.length()>0&&status.find(val) == -1)
{ {
AOM_ask_value_string(lines[j], "bl_rev_object_string", &val); AOM_ask_value_string(lines[j], "bl_rev_object_string", &val);
ss << val << ','; ss << val << ',';
@ -68,7 +68,7 @@ int bs_bom_check(EPM_rule_message_t msg)
} }
BOM_set_window_top_line(win, NULLTAG, attachments[i], NULLTAG, &top); BOM_set_window_top_line(win, NULLTAG, attachments[i], NULLTAG, &top);
AOM_UIF_ask_value(top, "jd2_last_release_status", &val); AOM_UIF_ask_value(top, "jd2_last_release_status", &val);
if (tc_strlen(val) && paras["status"].find(val) != -1) if (tc_strlen(val) && paras["status"].find(val) == -1)
{ {
AOM_ask_value_string(top, "bl_rev_object_string", &val); AOM_ask_value_string(top, "bl_rev_object_string", &val);
ss << val << ','; ss << val << ',';

@ -97,6 +97,10 @@ int bs_sap_material(EPM_action_message_t msg) {
printf("revision get error\n"); printf("revision get error\n");
continue; continue;
} }
char *idddd, *nameeee;
AOM_ask_value_string(rev, "item_id", &idddd);
AOM_ask_value_string(rev, "object_name", &nameeee);
printf("===>id=%s,name=%s\n", idddd, nameeee);
char* item_type; char* item_type;
AOM_ask_value_string(rev, "object_type", &item_type); AOM_ask_value_string(rev, "object_type", &item_type);
int pref_cnt; int pref_cnt;
@ -162,10 +166,16 @@ int bs_sap_material(EPM_action_message_t msg) {
AOM_ask_value_string(form, "jd2_flbm", &temp); AOM_ask_value_string(form, "jd2_flbm", &temp);
cout << "class prop id 1069, jd2_flbm:" << temp << endl; cout << "class prop id 1069, jd2_flbm:" << temp << endl;
dic[convert_to_cstring(class_map[ids[j]].c_str())] = convert_to_cstring(temp); dic[convert_to_cstring(class_map[ids[j]].c_str())] = convert_to_cstring(temp);
printf("--------ÌØÊâ1069------\n", ids[j]);
printf("value1:%s\n", convert_to_cstring(class_map[ids[j]].c_str()));
printf("value2:%s\n", convert_to_cstring(temp));
} }
else { else {
if (val_count[j]) { if (val_count[j]) {
dic[convert_to_cstring(class_map[ids[j]].c_str())] = convert_to_cstring(vals[j][0]); dic[convert_to_cstring(class_map[ids[j]].c_str())] = convert_to_cstring(vals[j][0]);
printf("--------------\n", ids[j]);
printf("value1:%s\n", convert_to_cstring(class_map[ids[j]].c_str()));
printf("value2:%s\n", convert_to_cstring(vals[j][0]));
} }
} }
} }

@ -0,0 +1,54 @@
#include "util.h"
int check_release_issus(EPM_rule_message_t msg) {
POM_AM__set_application_bypass(true);
tag_t root_task, * attachments;
int att_cnt;
//获得根节点
EPM_ask_root_task(msg.task, &root_task);
//获得根任务下的组件
EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments);
//判断参数是否符合要求
char* object_string;
std::string names = "";
int bjNum = 0;
//遍历任务组件
for (int i = 0; i < att_cnt; i++) {
if (isTypeOf(attachments[i], "ItemRevision")) {
//判断版本属性 release_status_list (是否发布)
int release_att;
tag_t* release;
AOM_ask_value_tags(attachments[i], "release_status_list", &release_att, &release);
cout << "release_att:" << release_att << endl;
cout << "release:" << release << endl;
if (release_att >= 1) {
continue;
}
else {
//如果date_released没有,打一个标记,并记录所有没有的对象
bjNum = -1;
AOM_ask_value_string(attachments[i], "object_string", &object_string);
names.append(object_string);
names.append(";");
}
}
}
if (bjNum == -1) {
std::string massage = "物料/图纸当前版本未发布!";
names.append(massage);
const char* p = names.c_str();
cout << "Exception:" << p << endl;
EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, p);
return EPM_nogo;
}
POM_AM__set_application_bypass(false);
return EPM_go;
}

@ -64,6 +64,8 @@ extern "C" {
int jd_rev_release(EPM_rule_message_t msg); int jd_rev_release(EPM_rule_message_t msg);
int jd_prop_relate(METHOD_message_t *msg, va_list args); int jd_prop_relate(METHOD_message_t *msg, va_list args);
int jd_splicing_task(EPM_action_message_t msg); int jd_splicing_task(EPM_action_message_t msg);
int check_release_issus(EPM_rule_message_t msg);
int Sample_confirmation_sheet(EPM_rule_message_t msg);
////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣǩ<CFA2><C7A9><EFBFBD><E6B1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ ////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣǩ<CFA2><C7A9><EFBFBD><E6B1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ
//int qtmc_sign_ir(EPM_action_message_t msg); //int qtmc_sign_ir(EPM_action_message_t msg);

@ -270,6 +270,24 @@ extern DLLAPI int CUST_init_module(int *decision, va_list args) {
// fprintf(stdout , "Registering action handler qtmc-sign-ir failed %d!\n",ifail); // fprintf(stdout , "Registering action handler qtmc-sign-ir failed %d!\n",ifail);
//} //}
ifail = EPM_register_rule_handler("check_release_issus", "check_release_issus",
(EPM_rule_handler_t)check_release_issus);
if (ifail) {
printf("register check_release_issus failed\n");
}
else {
printf("register check_release_issus successfully\n");
}
ifail = EPM_register_rule_handler("Sample_confirmation_sheet", "Sample_confirmation_sheet",
(EPM_rule_handler_t)Sample_confirmation_sheet);
if (ifail) {
printf("register Sample_confirmation_sheet failed\n");
}
else {
printf("register Sample_confirmation_sheet successfully\n");
}
return ifail; return ifail;
} }
// //

@ -1,4 +1,7 @@
#include "util.h" #include "util.h"
#include <ae/dataset.h>
#include <sa/am.h>
static void add_int_to_int_array(int add_int, int *n_int_array, int **int_array) { static void add_int_to_int_array(int add_int, int *n_int_array, int **int_array) {
int count = *n_int_array; int count = *n_int_array;
@ -43,59 +46,68 @@ static void revise_item_revisions(int num_target_objs, tag_t *target_object_tags
for (int ii = 0; ii < num_target_objs; ii++) { for (int ii = 0; ii < num_target_objs; ii++) {
tag_t type_tag = NULLTAG; tag_t type_tag = NULLTAG;
//询问对象的类型。
TCTYPE_ask_object_type(target_object_tags[ii], &type_tag); TCTYPE_ask_object_type(target_object_tags[ii], &type_tag);
tag_t revise_input_tag = NULLTAG; tag_t revise_input_tag = NULLTAG;
//为输入业务对象构造一个SaveAsInput对象。
//使用这个SaveAsInput对象来保存用于创建对象的输入数据。
TCTYPE_construct_operationinput(type_tag, TCTYPE_OPERATIONINPUT_REVISE, &revise_input_tag); TCTYPE_construct_operationinput(type_tag, TCTYPE_OPERATIONINPUT_REVISE, &revise_input_tag);
revise_input_tags[ii] = revise_input_tag; revise_input_tags[ii] = revise_input_tag;
printf("\nTarget Objects::\n"); printf("\nTarget Objects::\n");
int attached_object_count = 0; int attached_object_count = 0;
tag_t *deepcopydata_tags = NULL; tag_t *deepcopydata_tags = NULL;
//检索输入对象(正在进行的顶级对象)的DeepCopyData标记opvar指定的操作类型如SaveAs或modify。
TCTYPE_ask_deepcopydata(target_object_tags[ii], TCTYPE_ask_deepcopydata(target_object_tags[ii],
TCTYPE_OPERATIONINPUT_REVISE, &attached_object_count, &deepcopydata_tags); TCTYPE_OPERATIONINPUT_REVISE, &attached_object_count, &deepcopydata_tags);
tag_t last_object = NULLTAG; tag_t last_object = NULLTAG;
for (int jj = 0; jj < attached_object_count; jj++) { for (int jj = 0; jj < attached_object_count; jj++) {
AOM_ask_value_tag(deepcopydata_tags[jj], "targetObject", //询问单值属性的值。
&object_tag); AOM_ask_value_tag(deepcopydata_tags[jj], "targetObject",&object_tag);
if (object_tag != last_object) { if (object_tag != last_object) {
//返回指定工作空间对象的对象ID。字符串是出现在工作区显示的对象列中的对象ID。
WSOM_ask_object_id_string(object_tag, &id_string); WSOM_ask_object_id_string(object_tag, &id_string);
//询问对象的类型。
TCTYPE_ask_object_type(object_tag, &type_tag); TCTYPE_ask_object_type(object_tag, &type_tag);
//询问类型的名称。
TCTYPE_ask_name(type_tag, type_name); TCTYPE_ask_name(type_tag, type_name);
printf("%s (%s)\n", id_string, type_name); printf("%s (%s)\n", id_string, type_name);
} }
last_object = object_tag; last_object = object_tag;
//询问单值属性的值。
AOM_ask_value_tag(deepcopydata_tags[jj], "attachedObject", &object_tag); AOM_ask_value_tag(deepcopydata_tags[jj], "attachedObject", &object_tag);
if (object_tag != NULLTAG) { if (object_tag != NULLTAG) {
//返回指定工作空间对象的对象ID。字符串是出现在工作区显示的对象列中的对象ID。
WSOM_ask_object_id_string(object_tag, &id_string); WSOM_ask_object_id_string(object_tag, &id_string);
//询问对象的类型。
TCTYPE_ask_object_type(object_tag, &type_tag); TCTYPE_ask_object_type(object_tag, &type_tag);
//询问类型的名称。
TCTYPE_ask_name(type_tag, type_name); TCTYPE_ask_name(type_tag, type_name);
printf("attachedObject: %s (%s)\n", id_string, type_name); printf("attachedObject: %s (%s)\n", id_string, type_name);
} }
} }
if (attached_object_count > 0) { if (attached_object_count > 0) {
add_int_to_int_array(attached_object_count, &n_ints_in_list, add_int_to_int_array(attached_object_count, &n_ints_in_list,&all_attached_object_count);
&all_attached_object_count);
for (int jj = 0; jj < attached_object_count; jj++) { for (int jj = 0; jj < attached_object_count; jj++) {
add_tag_to_tag_array(deepcopydata_tags[jj], &n_tags_in_list, add_tag_to_tag_array(deepcopydata_tags[jj], &n_tags_in_list,&all_deepcopydata_tags);
&all_deepcopydata_tags);
} }
} }
if (deepcopydata_tags) MEM_free(deepcopydata_tags); if (deepcopydata_tags) MEM_free(deepcopydata_tags);
} }
//控件中的修改数据对指定的输入对象进行修改,属性和深度复制附加的对象,DeepCopyData提供。
TCTYPE_revise_objects(num_target_objs, target_object_tags, TCTYPE_revise_objects(num_target_objs, target_object_tags,
revise_input_tags, all_attached_object_count, all_deepcopydata_tags, revise_input_tags, all_attached_object_count, all_deepcopydata_tags,
&target_copy_tags, &ifails); &target_copy_tags, &ifails);
printf("\nNew Revisions:\n"); printf("\nNew Revisions:\n");
for (int ii = 0; ii < num_target_objs; ii++) { for (int ii = 0; ii < num_target_objs; ii++) {
//返回指定工作空间对象的对象ID。字符串是出现在工作区显示的对象列中的对象ID。
WSOM_ask_object_id_string(target_copy_tags[ii], WSOM_ask_object_id_string(target_copy_tags[ii],&id_string);
&id_string); //询问对象的类型。
TCTYPE_ask_object_type(target_copy_tags[ii], &type_tag); TCTYPE_ask_object_type(target_copy_tags[ii], &type_tag);
//询问类型的名称。
TCTYPE_ask_name(type_tag, type_name); TCTYPE_ask_name(type_tag, type_name);
if (ifails[ii] == ITK_ok) { if (ifails[ii] == ITK_ok) {
@ -118,17 +130,93 @@ static void revise_item_revisions(int num_target_objs, tag_t *target_object_tags
if (id_string) MEM_free(id_string); if (id_string) MEM_free(id_string);
} }
static int grant_access(tag_t dataset_tag, tag_t user)
{
int ifail = ITK_ok;
tag_t write_prev = NULLTAG;
ifail = AOM_refresh(dataset_tag, POM_modify_lock);
if (ifail != ITK_ok)
{
return ifail;
}
ifail = AM_find_privilege("WRITE", &write_prev);
if (ifail != ITK_ok)
{
AOM_unlock(dataset_tag);
return ifail;
}
ifail = AM_grant_privilege(dataset_tag, user, write_prev);//赋予写权限
if (ifail != ITK_ok)
{
AOM_unlock(dataset_tag);
return ifail;
}
ifail = AM_save_acl(dataset_tag);
if (ifail != ITK_ok)
{
AOM_unlock(dataset_tag);
return ifail;
}
ifail = AE_save_myself(dataset_tag);
if (ifail != ITK_ok)
{
AOM_unlock(dataset_tag);
return ifail;
}
return ifail;
}
int jd_auto_revise(EPM_action_message_t msg) { int jd_auto_revise(EPM_action_message_t msg) {
int att_cnt; int att_cnt;
tag_t root_task, *attachments; tag_t root_task, *attachments;
//获得根节点
EPM_ask_root_task(msg.task, &root_task); EPM_ask_root_task(msg.task, &root_task);
//获得根任务下的组件
EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments); EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments);
vector<tag_t> revs; vector<tag_t> revs;
vector<tag_t> tags; vector<tag_t> tags;
vector<tag_t> items;
POM_AM__set_application_bypass(true); POM_AM__set_application_bypass(true);
//遍历任务组件
for (int i = 0;i < att_cnt;i++) { for (int i = 0;i < att_cnt;i++) {
if (isTypeOf(attachments[i], "ItemRevision")) { if (isTypeOf(attachments[i], "ItemRevision")) {
revs.push_back(attachments[i]); revs.push_back(attachments[i]);
//////////////////////////////////////////////////////////////////////////////////////
int object_att;
tag_t* object;
//得到零组件
AOM_ask_value_tags(attachments[i], "items_tag", &object_att, &object);
tag_t owning_user, group;
//询问单值属性的值。获取对象所有者
AOM_ask_value_tag(msg.task, "owning_user", &owning_user);
//给写权限
grant_access(object[0], owning_user);
//返回用户的默认登录组属性。
//SA_ask_user_login_group(owning_user, &group);
//AOM_lock(object[0]);
//int res = ITK_ok;
//char* uid;
////设置对象的用户和组所有权。
//ITKCALL(AOM_set_ownership(object[0], owning_user, group));
////将应用程序对象保存到数据库中。在调用save之前必须首先加载或刷新对象以进行修改。
//ITKCALL(res = AOM_save(object[0]));
//if (res != ITK_ok) {
// //注意返回的“UID”对于一个BOM标签不是持久化到另一个会话并且对于道具标签是无效的
// ITK__convert_tag_to_uid(object[0], &uid);
// cout << uid << endl;
// //释放指定的内存块。
// if (uid) MEM_free(uid);
//}
//AOM_unlock(object[0]);
//////////////////////////////////////////////////////////////////////////////////////
} }
} }
revise_item_revisions(revs.size(), &revs[0], &tags); revise_item_revisions(revs.size(), &revs[0], &tags);
@ -136,22 +224,29 @@ int jd_auto_revise(EPM_action_message_t msg) {
tag_t owning_user, group; tag_t owning_user, group;
char *name, **prefs; char *name, **prefs;
int prefs_cnt = 0, tags_cnt = tags.size(); int prefs_cnt = 0, tags_cnt = tags.size();
//询问单值属性的值。获取对象所有者
AOM_ask_value_tag(msg.task, "owning_user", &owning_user); AOM_ask_value_tag(msg.task, "owning_user", &owning_user);
//询问单值属性的值。获取用户name
AOM_ask_value_string(owning_user, "object_string", &name); AOM_ask_value_string(owning_user, "object_string", &name);
cout << "owning_user:" << name << endl; cout << "owning_user:" << name << endl;
//返回用户的默认登录组属性。
SA_ask_user_login_group(owning_user, &group); SA_ask_user_login_group(owning_user, &group);
char *group_name; char *group_name;
//询问单值属性的值。
AOM_ask_value_string(group, "object_string", &group_name); AOM_ask_value_string(group, "object_string", &group_name);
cout << "group name:" << group_name << endl; cout << "group name:" << group_name << endl;
//询问数据类型为“String”的首选项的所有值。
PREF_ask_char_values("jd2_auto_revise_relations", &prefs_cnt, &prefs); PREF_ask_char_values("jd2_auto_revise_relations", &prefs_cnt, &prefs);
for (int i = 0;i < prefs_cnt;i++) { for (int i = 0;i < prefs_cnt;i++) {
cout << "relation:" << prefs[i] << endl; cout << "relation:" << prefs[i] << endl;
for (int ii = 0;ii < tags_cnt;ii++) { for (int ii = 0;ii < tags_cnt;ii++) {
tag_t *temp; tag_t *temp;
int num = 0; int num = 0;
//询问属性的一个或多个值。属性可以是单值的,也可以是多值的(例如,数组或列表)。
AOM_ask_value_tags(tags[ii], prefs[i], &num, &temp); AOM_ask_value_tags(tags[ii], prefs[i], &num, &temp);
for (int iii = 0;iii < num;iii++) { for (int iii = 0;iii < num;iii++) {
char *str; char *str;
//询问单值属性的值。
AOM_ask_value_string(temp[iii], "object_string", &str); AOM_ask_value_string(temp[iii], "object_string", &str);
cout << "add name:" << str << endl; cout << "add name:" << str << endl;
tags.push_back(temp[iii]); tags.push_back(temp[iii]);
@ -163,11 +258,15 @@ int jd_auto_revise(EPM_action_message_t msg) {
AOM_lock(tags[i]); AOM_lock(tags[i]);
int res = ITK_ok; int res = ITK_ok;
char *uid; char *uid;
//设置对象的用户和组所有权。
ITKCALL(AOM_set_ownership(tags[i], owning_user, group)); ITKCALL(AOM_set_ownership(tags[i], owning_user, group));
//将应用程序对象保存到数据库中。在调用save之前必须首先加载或刷新对象以进行修改。
ITKCALL(res = AOM_save(tags[i])); ITKCALL(res = AOM_save(tags[i]));
if (res != ITK_ok) { if (res != ITK_ok) {
//注意返回的“UID”对于一个BOM标签不是持久化到另一个会话并且对于道具标签是无效的
ITK__convert_tag_to_uid(tags[i], &uid); ITK__convert_tag_to_uid(tags[i], &uid);
cout << uid << endl; cout << uid << endl;
//释放指定的内存块。
if (uid) MEM_free(uid); if (uid) MEM_free(uid);
} }
AOM_unlock(tags[i]); AOM_unlock(tags[i]);

@ -1,4 +1,4 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.24215.1 ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23026.0
; Generated by VC++ for Common Language Runtime ; Generated by VC++ for Common Language Runtime
.file "C:\Users\5rKB5bPlusD\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp" .file "C:\Users\Administrator\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp"

@ -1,49 +1,51 @@
e:\work\vs_workspace\jditk\hezon_itk\x64\release\vc140.pdb c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\vc140.pdb
e:\work\vs_workspace\jditk\hezon_itk\x64\release\epm_register_handler.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_send_mail.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_send_mail.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_prop_relate.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_prop_relate.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_get_target2.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_get_target2.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_get_target.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_get_target.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_ckeck_bom_use.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_ckeck_bom_use.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_check_bom_99.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_check_bom_99.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_check_99_cglx.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_check_99_cglx.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_auto_revise.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_auto_revise.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\csendmail.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\csendmail.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\check_release_issus.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_wl_check.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_wl_check.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_test_release_check.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_test_release_check.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_sign_cad.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_sign_cad.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_signoff.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_signoff.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_sap.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_sap.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_file_transfer.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_file_transfer.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_bypass.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_bypass.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_bom_transmit_check.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_bom_transmit_check.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_bom_save_check.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_bom_save_check.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_bom_check.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_bom_check.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_rev_release.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_rev_release.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_check_id_wllx.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_check_id_wllx.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\util.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\util.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_splicing_task.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\sample_confirmation_sheet.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_check_wlms_len.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_splicing_task.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_signoff.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_check_wlms_len.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_send_mail2.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_signoff.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_schedule_joint.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_send_mail2.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_clear_field.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_schedule_joint.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_check_99_bomyt.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_clear_field.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_batch_process.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_check_99_bomyt.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\jd_add_attachments.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_batch_process.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\bs_custom_main.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\jd_add_attachments.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\.netframework,version=v4.0.assemblyattributes.obj c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\bs_custom_main.obj
e:\work\vs_workspace\jditk\hezon_itk\x64\release\.netframework,version=v4.0.assemblyattributes.asm c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\epm_register_handler.obj
e:\work\vs_workspace\jditk\x64\release\bs.dll c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\.netframework,version=v4.0.assemblyattributes.obj
e:\work\vs_workspace\jditk\x64\release\hezon_itk.pdb c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\.netframework,version=v4.0.assemblyattributes.asm
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\metagen.write.1.tlog c:\users\administrator\desktop\vs\吉德\itk\x64\release\bs.dll
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.vcxprojresolveassemblyreference.cache c:\users\administrator\desktop\vs\吉德\itk\x64\release\hezon_itk.pdb
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\cl.command.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\metagen.write.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\cl.read.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.vcxprojresolveassemblyreference.cache
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\cl.write.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\cl.command.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\link.command.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\cl.read.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\link.read.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\cl.write.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\link.write.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\link.command.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\metagen.read.1.tlog c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\link.read.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\declib.dll.metagen c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\link.write.1.tlog
e:\work\vs_workspace\jditk\hezon_itk\x64\release\hezon_itk.tlog\tzres.dll.bi c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\metagen.read.1.tlog
c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\declib.dll.metagen
c:\users\administrator\desktop\vs\吉德\itk\hezon_itk\x64\release\hezon_itk.tlog\tzres.dll.bi

@ -1,2 +0,0 @@
#v4.0:v110:false
Release|x64|C:\Users\Administrator\Documents\c++\HEZON_ITK\|

@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=true:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=true:VCToolArchitecture=Native32Bit
Release|x64|E:\work\vs_workspace\jditk\| Release|x64|C:\Users\Administrator\Desktop\VS\吉德\itk\|

Loading…
Cancel
Save