|
|
|
@ -357,12 +357,12 @@ void getGxbmMap(tag_t processTag, map<string, tag_t>& gxDocMap, map<string, Time
|
|
|
|
|
tag_t ebom_window = NULLTAG;
|
|
|
|
|
tag_t bom_line = NULLTAG;
|
|
|
|
|
tag_t item_tag = NULLTAG, *c_line_tags;
|
|
|
|
|
(BOM_create_window(&ebom_window));
|
|
|
|
|
ITKCALL(BOM_create_window(&ebom_window));
|
|
|
|
|
tag_t* bvr_list = NULL;
|
|
|
|
|
(ITEM_rev_list_bom_view_revs(processTag, &bvr_count, &bvr_list));
|
|
|
|
|
ITKCALL(ITEM_rev_list_bom_view_revs(processTag, &bvr_count, &bvr_list));
|
|
|
|
|
printf("bvr_count=%d", bvr_count);
|
|
|
|
|
|
|
|
|
|
(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
//bom_line工艺
|
|
|
|
|
int c_line_count;
|
|
|
|
|
ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // 一级工序
|
|
|
|
@ -371,55 +371,55 @@ void getGxbmMap(tag_t processTag, map<string, tag_t>& gxDocMap, map<string, Time
|
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
|
tag_t oneGx = c_line_tags[i], *towGxLines;
|
|
|
|
|
char* gxbm1;
|
|
|
|
|
AOM_ask_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm1);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm1));
|
|
|
|
|
if (timebeans.count(gxbm1) > 0) {
|
|
|
|
|
AOM_lock(oneGx);
|
|
|
|
|
ITKCALL(AOM_lock(oneGx));
|
|
|
|
|
TimeBean tbean = timebeans[gxbm1];
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ArtificialTime", tbean.rgsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_MachineTime", tbean.jqsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ReadinessTime", tbean.zbsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ProCycle", tbean.zrsczq.c_str()));
|
|
|
|
|
AOM_save(oneGx);
|
|
|
|
|
AOM_unlock(oneGx);
|
|
|
|
|
ITKCALL(AOM_save(oneGx));
|
|
|
|
|
ITKCALL(AOM_unlock(oneGx));
|
|
|
|
|
}
|
|
|
|
|
int c_cnt = 0;
|
|
|
|
|
BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines);
|
|
|
|
|
ITKCALL(BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines));
|
|
|
|
|
for (int j = 0; j < c_cnt; j++) {
|
|
|
|
|
tag_t towGxLine = towGxLines[j];
|
|
|
|
|
tag_t towGx;
|
|
|
|
|
char* gxbm2;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm2));
|
|
|
|
|
if (timebeans.count(gxbm2) > 0) {
|
|
|
|
|
AOM_lock(towGxLine);
|
|
|
|
|
ITKCALL(AOM_lock(towGxLine));
|
|
|
|
|
TimeBean tbean = timebeans[gxbm2];
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ArtificialTime", tbean.rgsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_MachineTime", tbean.jqsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ReadinessTime", tbean.zbsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ProCycle", tbean.zrsczq.c_str()));
|
|
|
|
|
AOM_save(towGxLine);
|
|
|
|
|
AOM_unlock(towGxLine);
|
|
|
|
|
ITKCALL(AOM_save(towGxLine));
|
|
|
|
|
ITKCALL(AOM_unlock(towGxLine));
|
|
|
|
|
}
|
|
|
|
|
char *name;
|
|
|
|
|
char* name = NULL;
|
|
|
|
|
ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &towGx));
|
|
|
|
|
AOM_ask_value_string(towGx, "object_name", &name);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(towGx, "object_name", &name));
|
|
|
|
|
//设置质检项
|
|
|
|
|
//setZljyx(gxbm2,th, lastId, name, towGx);
|
|
|
|
|
if (flBeanMap.count(gxbm2) > 0) {
|
|
|
|
|
vector<FlBean> beansVec = flBeanMap[gxbm2];
|
|
|
|
|
printf("beansVec===>%d\n", beansVec.size());
|
|
|
|
|
printf("beansVec===>%zd\n", beansVec.size());
|
|
|
|
|
if (beansVec.size() > 0) {
|
|
|
|
|
tag_t axqPmatnr;
|
|
|
|
|
AOM_ask_value_tag(towGxLine, "bl_line_object", &axqPmatnr);
|
|
|
|
|
(ITEM_rev_list_bom_view_revs(axqPmatnr, &bvr_count, &bvr_list));
|
|
|
|
|
ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &axqPmatnr));
|
|
|
|
|
ITKCALL(ITEM_rev_list_bom_view_revs(axqPmatnr, &bvr_count, &bvr_list));
|
|
|
|
|
printf("bvr_count=%d\n", bvr_count);
|
|
|
|
|
if (bvr_count == 0) {
|
|
|
|
|
tag_t newView, newViewBvr, pitem;
|
|
|
|
|
ITEM_ask_item_of_rev(axqPmatnr, &pitem);
|
|
|
|
|
ITKCALL(ITEM_ask_item_of_rev(axqPmatnr, &pitem));
|
|
|
|
|
ITKCALL(PS_create_bom_view(NULL, NULL, NULL, pitem, &newView));
|
|
|
|
|
AOM_save(newView);
|
|
|
|
|
ITKCALL(AOM_save(newView));
|
|
|
|
|
ITKCALL(PS_create_bvr(newView, NULL, NULL, FALSE, axqPmatnr, &newViewBvr));
|
|
|
|
|
AOM_save(newViewBvr);
|
|
|
|
|
AOM_save(axqPmatnr);
|
|
|
|
|
ITKCALL(AOM_save(newViewBvr));
|
|
|
|
|
ITKCALL(AOM_save(axqPmatnr));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//投辅料
|
|
|
|
@ -430,16 +430,16 @@ void getGxbmMap(tag_t processTag, map<string, tag_t>& gxDocMap, map<string, Time
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
ITKCALL(BOM_line_add(towGxLine, NULL, cBean.flTag, NULL, &cLine));
|
|
|
|
|
AOM_lock(cLine);
|
|
|
|
|
ITKCALL(AOM_lock(cLine));
|
|
|
|
|
string num = cBean.blQty;
|
|
|
|
|
AOM_set_value_string(cLine, "bl_quantity", num.c_str());
|
|
|
|
|
ITKCALL(AOM_set_value_string(cLine, "bl_quantity", num.c_str()));
|
|
|
|
|
string seqNo = to_string((n + 1) * 10);
|
|
|
|
|
AOM_set_value_string(cLine, "bl_sequence_no", seqNo.c_str());
|
|
|
|
|
AOM_set_value_string(cLine, "bl_occ_type", "ZT2_FuLiao");
|
|
|
|
|
AOM_save(cLine);
|
|
|
|
|
ITKCALL(AOM_set_value_string(cLine, "bl_sequence_no", seqNo.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(cLine, "bl_occ_type", "ZT2_FuLiao"));
|
|
|
|
|
ITKCALL(AOM_save(cLine));
|
|
|
|
|
//最后unlock
|
|
|
|
|
AOM_unlock(cLine);
|
|
|
|
|
AOM_refresh(cLine, FALSE);
|
|
|
|
|
ITKCALL(AOM_unlock(cLine));
|
|
|
|
|
ITKCALL(AOM_refresh(cLine, FALSE));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -447,20 +447,18 @@ void getGxbmMap(tag_t processTag, map<string, tag_t>& gxDocMap, map<string, Time
|
|
|
|
|
gxDocMap[gxbm2] = towGx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BOM_save_window(ebom_window);
|
|
|
|
|
BOM_close_window(ebom_window);
|
|
|
|
|
ITKCALL(BOM_save_window(ebom_window));
|
|
|
|
|
ITKCALL(BOM_close_window(ebom_window));
|
|
|
|
|
}
|
|
|
|
|
void getGxbmMap(tag_t processTag, map<string, tag_t>& gxDocMap, map<string, TimeBean > timebeans) {
|
|
|
|
|
int bvr_count = 0;
|
|
|
|
|
tag_t ebom_window = NULLTAG;
|
|
|
|
|
tag_t bom_line = NULLTAG;
|
|
|
|
|
tag_t item_tag = NULLTAG, *c_line_tags;
|
|
|
|
|
(BOM_create_window(&ebom_window));
|
|
|
|
|
tag_t ebom_window = NULLTAG, bom_line = NULLTAG, item_tag = NULLTAG, *c_line_tags = NULLTAG;
|
|
|
|
|
ITKCALL(BOM_create_window(&ebom_window));
|
|
|
|
|
tag_t* bvr_list = NULL;
|
|
|
|
|
(ITEM_rev_list_bom_view_revs(processTag, &bvr_count, &bvr_list));
|
|
|
|
|
ITKCALL(ITEM_rev_list_bom_view_revs(processTag, &bvr_count, &bvr_list));
|
|
|
|
|
printf("bvr_count=%d", bvr_count);
|
|
|
|
|
|
|
|
|
|
(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
//bom_line工艺
|
|
|
|
|
int c_line_count;
|
|
|
|
|
ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // 一级工序
|
|
|
|
@ -468,39 +466,39 @@ void getGxbmMap(tag_t processTag, map<string, tag_t>& gxDocMap, map<string, Time
|
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
|
tag_t oneGx = c_line_tags[i], *towGxLines;
|
|
|
|
|
char* gxbm1;
|
|
|
|
|
AOM_ask_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm1);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm1));
|
|
|
|
|
if (timebeans.count(gxbm1) > 0) {
|
|
|
|
|
AOM_lock(oneGx);
|
|
|
|
|
ITKCALL(AOM_lock(oneGx));
|
|
|
|
|
TimeBean tbean = timebeans[gxbm1];
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ArtificialTime", tbean.rgsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_MachineTime", tbean.jqsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ReadinessTime", tbean.zbsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ProCycle", tbean.zrsczq.c_str()));
|
|
|
|
|
AOM_save(oneGx);
|
|
|
|
|
AOM_unlock(oneGx);
|
|
|
|
|
ITKCALL(AOM_save(oneGx));
|
|
|
|
|
ITKCALL(AOM_unlock(oneGx));
|
|
|
|
|
}
|
|
|
|
|
int c_cnt = 0;
|
|
|
|
|
BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines);
|
|
|
|
|
ITKCALL(BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines));
|
|
|
|
|
for (int j = 0; j < c_cnt; j++) {
|
|
|
|
|
tag_t towGxLine = towGxLines[j];
|
|
|
|
|
tag_t towGx;
|
|
|
|
|
char* gxbm2;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm2));
|
|
|
|
|
if (timebeans.count(gxbm2) > 0) {
|
|
|
|
|
AOM_lock(towGxLine);
|
|
|
|
|
ITKCALL(AOM_lock(towGxLine));
|
|
|
|
|
TimeBean tbean = timebeans[gxbm2];
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ArtificialTime", tbean.rgsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_MachineTime", tbean.jqsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ReadinessTime", tbean.zbsj.c_str()));
|
|
|
|
|
ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ProCycle", tbean.zrsczq.c_str()));
|
|
|
|
|
AOM_save(towGxLine);
|
|
|
|
|
AOM_unlock(towGxLine);
|
|
|
|
|
ITKCALL(AOM_save(towGxLine));
|
|
|
|
|
ITKCALL(AOM_unlock(towGxLine));
|
|
|
|
|
}
|
|
|
|
|
ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &towGx));
|
|
|
|
|
gxDocMap[gxbm2] = towGx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BOM_close_window(ebom_window);
|
|
|
|
|
ITKCALL(BOM_close_window(ebom_window));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询ID
|
|
|
|
@ -559,9 +557,9 @@ tag_t clone_process_from_template(char* process_item_id, boolean isXq, string pr
|
|
|
|
|
tag_t revision_tag = NULLTAG;
|
|
|
|
|
ITKCALL(ITEM_ask_latest_rev(item_tag, &revision_tag));
|
|
|
|
|
char* nameOld, *item_revision_id;
|
|
|
|
|
AOM_ask_value_string(revision_tag, "item_revision_id", &item_revision_id);
|
|
|
|
|
AOM_ask_value_string(revision_tag, "object_name", &nameOld);
|
|
|
|
|
MEBOM_init_module();
|
|
|
|
|
ITKCALL(AOM_ask_value_string(revision_tag, "item_revision_id", &item_revision_id));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(revision_tag, "object_name", &nameOld));
|
|
|
|
|
ITKCALL(MEBOM_init_module());
|
|
|
|
|
|
|
|
|
|
tag_t window_tag = NULLTAG;
|
|
|
|
|
ITKCALL(ME_create_bop_window(&window_tag));
|
|
|
|
@ -783,9 +781,9 @@ boolean isXn(tag_t matnr) {
|
|
|
|
|
//获取分类属性 判断是否整除
|
|
|
|
|
string getClassVal(tag_t top_rev_tag, string& errMessage, ByqBean &bean) {
|
|
|
|
|
//, string className
|
|
|
|
|
tag_t top_classificationObject, item;
|
|
|
|
|
tag_t top_classificationObject = NULLTAG, item = NULLTAG;
|
|
|
|
|
ITKCALL(ITEM_ask_item_of_rev(top_rev_tag, &item));
|
|
|
|
|
ICS_ask_classification_object(item, &top_classificationObject);
|
|
|
|
|
ITKCALL(ICS_ask_classification_object(item, &top_classificationObject));
|
|
|
|
|
if (top_classificationObject == NULL_TAG)
|
|
|
|
|
{
|
|
|
|
|
errMessage.append("顶层对象没有发送到分类\n");
|
|
|
|
@ -796,8 +794,7 @@ string getClassVal(tag_t top_rev_tag, string& errMessage, ByqBean &bean) {
|
|
|
|
|
//ICS_ask_id_name(top_class_tag, &top_class_id, &top_class_name);
|
|
|
|
|
printf("BOM TOP LINE CLASS ID = %s | NAME = %s \n", top_class_id, top_class_name);
|
|
|
|
|
int n_attrs;
|
|
|
|
|
char** attr_names;
|
|
|
|
|
char** attr_vals;
|
|
|
|
|
char** attr_names = NULL, ** attr_vals = NULL;
|
|
|
|
|
ITKCALL(ICS_ask_attributes_of_classification_obj(top_classificationObject, &n_attrs, &attr_names, &attr_vals));
|
|
|
|
|
cout << n_attrs << endl;
|
|
|
|
|
// int num = 1;
|
|
|
|
@ -998,7 +995,7 @@ boolean isTcmOnNot(tag_t process) {
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
void readProcessBom(tag_t bom_line, string& errorBuff,boolean &flag,tag_t &topProcess,string ¬TcmBuff) {
|
|
|
|
|
void readProcessBom(tag_t bom_line, string& errorBuff, boolean &flag, tag_t &topProcess, string ¬TcmBuff, string back) {
|
|
|
|
|
|
|
|
|
|
int c_line_count;
|
|
|
|
|
tag_t mantr, *c_line_tags;
|
|
|
|
@ -1021,116 +1018,127 @@ void readProcessBom(tag_t bom_line, string& errorBuff,boolean &flag,tag_t &topPr
|
|
|
|
|
{
|
|
|
|
|
char* refType;
|
|
|
|
|
tag_t refTag = references_tag[i];
|
|
|
|
|
AOM_ask_value_string(refTag, "object_type", &refType);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(refTag, "object_type", &refType));
|
|
|
|
|
if (strcmp(refType, "MEProcessRevision") == 0) {
|
|
|
|
|
hasProcess = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("hasProcess==%d\n", hasProcess);
|
|
|
|
|
if (!hasProcess) {
|
|
|
|
|
char* bl_desc,*itemID;
|
|
|
|
|
AOM_ask_value_string(mantr, "item_id", &itemID);
|
|
|
|
|
{
|
|
|
|
|
if (strstr(objName, "变压器") != NULL) {
|
|
|
|
|
tag_t *byqRev;
|
|
|
|
|
string tmpGyId;
|
|
|
|
|
char *uid;
|
|
|
|
|
int cnt3 = 0;
|
|
|
|
|
AOM_ask_value_tags(mantr, "TC_Is_Represented_By", &cnt3, &byqRev);
|
|
|
|
|
ByqBean bean;
|
|
|
|
|
ITK__convert_tag_to_uid(byqRev[0], &uid);
|
|
|
|
|
printf("objName%s %s\n", objName, uid);
|
|
|
|
|
string cpxh = getClassVal(byqRev[0], errorBuff, bean);
|
|
|
|
|
char* thId;
|
|
|
|
|
AOM_ask_value_string(byqRev[0],"item_id",& thId);
|
|
|
|
|
printf("cpxh===>%s\n", cpxh.c_str());
|
|
|
|
|
tag_t processTag = NULLTAG;
|
|
|
|
|
if (strstr(objName, "线圈") == NULL) {
|
|
|
|
|
vector<string> idVec;
|
|
|
|
|
Split2(thId, "-", idVec);
|
|
|
|
|
processTag = getTmpProcess(cpxh, "1ZDB300000P", errorBuff, tmpGyId, false, "", idVec[1]);
|
|
|
|
|
topProcess = processTag;
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
char* bl_desc = NULL, * itemID = NULL;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantr, "item_id", &itemID));
|
|
|
|
|
printf("back==%zd\n", back.size());
|
|
|
|
|
if (back.size() > 0) {
|
|
|
|
|
vector<string> backs;
|
|
|
|
|
Split2(back, "@", backs);
|
|
|
|
|
tag_t processTag = NULLTAG;
|
|
|
|
|
string tmpGyId;
|
|
|
|
|
processTag = getTmpProcess(backs[0], backs[1], errorBuff, tmpGyId, false, "", "");
|
|
|
|
|
topProcess = processTag;
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
printf("save_representation2\n");
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "变压器") != NULL) {
|
|
|
|
|
tag_t* byqRev = NULLTAG;
|
|
|
|
|
string tmpGyId;
|
|
|
|
|
char* uid = NULL;
|
|
|
|
|
int cnt3 = 0;
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(mantr, "TC_Is_Represented_By", &cnt3, &byqRev));
|
|
|
|
|
ByqBean bean;
|
|
|
|
|
ITK__convert_tag_to_uid(byqRev[0], &uid);
|
|
|
|
|
printf("objName%s %s\n", objName, uid);
|
|
|
|
|
string cpxh = getClassVal(byqRev[0], errorBuff, bean);
|
|
|
|
|
char* thId = NULL;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(byqRev[0], "item_id", &thId));
|
|
|
|
|
printf("cpxh===>%s\n", cpxh.c_str());
|
|
|
|
|
tag_t processTag = NULLTAG;
|
|
|
|
|
if (strstr(objName, "线圈") == NULL) {
|
|
|
|
|
vector<string> idVec;
|
|
|
|
|
Split2(thId, "-", idVec);
|
|
|
|
|
processTag = getTmpProcess(cpxh, "1ZDB300000P", errorBuff, tmpGyId, false, "", idVec[1]);
|
|
|
|
|
topProcess = processTag;
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc);
|
|
|
|
|
vector<string> descVec1;
|
|
|
|
|
Split2(bl_desc, " ", descVec1);
|
|
|
|
|
if (descVec1.size() > 1) {
|
|
|
|
|
string drawNos = descVec1[1];
|
|
|
|
|
vector<string> drawNoVec1;
|
|
|
|
|
Split2(drawNos, "-", drawNoVec1);
|
|
|
|
|
if (drawNoVec1.size() > 1) {
|
|
|
|
|
string wordNo = drawNoVec1[1]; //工程号 拼接1ZDB300000P 查找分类属性
|
|
|
|
|
string drawNo = drawNoVec1[0]; //图号
|
|
|
|
|
if (drawNoVec1.size() == 3) {
|
|
|
|
|
drawNo = drawNoVec1[0].append("-").append(drawNoVec1[1]);
|
|
|
|
|
wordNo = drawNoVec1[2];
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ITKCALL(AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc));
|
|
|
|
|
vector<string> descVec1;
|
|
|
|
|
Split2(bl_desc, " ", descVec1);
|
|
|
|
|
if (descVec1.size() > 1) {
|
|
|
|
|
string drawNos = descVec1[1];
|
|
|
|
|
vector<string> drawNoVec1;
|
|
|
|
|
Split2(drawNos, "-", drawNoVec1);
|
|
|
|
|
if (drawNoVec1.size() > 1) {
|
|
|
|
|
string wordNo = drawNoVec1[1]; //工程号 拼接1ZDB300000P 查找分类属性
|
|
|
|
|
string drawNo = drawNoVec1[0]; //图号
|
|
|
|
|
if (drawNoVec1.size() == 3) {
|
|
|
|
|
drawNo = drawNoVec1[0].append("-").append(drawNoVec1[1]);
|
|
|
|
|
wordNo = drawNoVec1[2];
|
|
|
|
|
}
|
|
|
|
|
string byqId = "1ZDB300000P-", tmpGyId;
|
|
|
|
|
tag_t byqTag = NULLTAG, byqRev = NULLTAG, processTag = NULLTAG;
|
|
|
|
|
byqId.append(wordNo);
|
|
|
|
|
ITKCALL(ITEM_find_item(byqId.c_str(), &byqTag));
|
|
|
|
|
ITKCALL(ITEM_ask_latest_rev(byqTag, &byqRev));
|
|
|
|
|
ByqBean bean;
|
|
|
|
|
string cpxh = getClassVal(byqRev, errorBuff, bean);
|
|
|
|
|
printf("cpxh===>%s\n", cpxh.c_str());
|
|
|
|
|
if (strstr(objName, "线圈") == NULL) {
|
|
|
|
|
processTag = getTmpProcess(cpxh, drawNo, errorBuff, tmpGyId, false, "", wordNo);
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
string byqId = "1ZDB300000P-", tmpGyId;
|
|
|
|
|
tag_t byqTag, byqRev;
|
|
|
|
|
byqId.append(wordNo);
|
|
|
|
|
ITKCALL(ITEM_find_item(byqId.c_str(), &byqTag));
|
|
|
|
|
ITKCALL(ITEM_ask_latest_rev(byqTag, &byqRev));
|
|
|
|
|
ByqBean bean;
|
|
|
|
|
string cpxh = getClassVal(byqRev, errorBuff, bean);
|
|
|
|
|
printf("cpxh===>%s\n", cpxh.c_str());
|
|
|
|
|
tag_t processTag = NULLTAG;
|
|
|
|
|
if (strstr(objName, "线圈") == NULL) {
|
|
|
|
|
processTag = getTmpProcess(cpxh, drawNo, errorBuff, tmpGyId, false, "", wordNo);
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
string xqfs;
|
|
|
|
|
if (strstr(objName, "低压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.dyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前低压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.dyxq;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
string xqfs;
|
|
|
|
|
if (strstr(objName, "低压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.dyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前低压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.dyxq;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "中压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.zyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前中压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.zyxq;
|
|
|
|
|
else if (strstr(objName, "中压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.zyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前中压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "高压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.gyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前高压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.gyxq;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "调压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.tyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前调压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.tyxq;
|
|
|
|
|
xqfs = bean.zyxq;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "高压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.gyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前高压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "稳压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.wyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前稳压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.wyxq;
|
|
|
|
|
xqfs = bean.gyxq;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "调压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.tyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前调压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
processTag = getTmpProcess(cpxh, drawNo, errorBuff, tmpGyId, true, xqfs, wordNo);
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
xqfs = bean.tyxq;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "稳压线圈") != NULL) {
|
|
|
|
|
//当前XXX线圈未在变压器参数表中维护绕线方式分类属性,请前往维护
|
|
|
|
|
if (bean.wyxq.empty()) {
|
|
|
|
|
errorBuff.append("当前稳压线圈未在变压器参数表中维护绕线方式分类属性,请前往维护\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
xqfs = bean.wyxq;
|
|
|
|
|
}
|
|
|
|
|
processTag = getTmpProcess(cpxh, drawNo, errorBuff, tmpGyId, true, xqfs, wordNo);
|
|
|
|
|
if (processTag != NULLTAG) {
|
|
|
|
|
save_representation2(processTag, mantr, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1138,9 +1146,10 @@ void readProcessBom(tag_t bom_line, string& errorBuff,boolean &flag,tag_t &topPr
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("sub readProcessBom\n");
|
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
|
tag_t c_line_tag = c_line_tags[i];
|
|
|
|
|
readProcessBom(c_line_tag, errorBuff,flag, topProcess, notTcmBuff);
|
|
|
|
|
readProcessBom(c_line_tag, errorBuff, flag, topProcess, notTcmBuff, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1157,7 +1166,7 @@ tag_t getProcess(tag_t designRev) {
|
|
|
|
|
{
|
|
|
|
|
char* refType;
|
|
|
|
|
tag_t refTag = references_tag[i];
|
|
|
|
|
AOM_ask_value_string(refTag, "object_type", &refType);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(refTag, "object_type", &refType));
|
|
|
|
|
if (strcmp(refType, "MEProcessRevision") == 0) {
|
|
|
|
|
hasProcess = true;
|
|
|
|
|
process = refTag;
|
|
|
|
@ -1176,17 +1185,17 @@ int CloneTempProcess(void *returnValue)
|
|
|
|
|
int bvr_count = 0, c_line_count;
|
|
|
|
|
tag_t ebom_window = NULLTAG;
|
|
|
|
|
tag_t bom_line = NULLTAG;
|
|
|
|
|
tag_t item_tag = NULLTAG, *c_line_tags;
|
|
|
|
|
tag_t item_tag = NULLTAG, *c_line_tags = NULLTAG;
|
|
|
|
|
(BOM_create_window(&ebom_window));
|
|
|
|
|
tag_t* bvr_list = NULL;
|
|
|
|
|
(ITEM_rev_list_bom_view_revs(designRev, &bvr_count, &bvr_list));
|
|
|
|
|
ITKCALL(ITEM_rev_list_bom_view_revs(designRev, &bvr_count, &bvr_list));
|
|
|
|
|
printf("bvr_count=%d", bvr_count);
|
|
|
|
|
|
|
|
|
|
(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
string errorBuff;
|
|
|
|
|
string notTcmBuff;
|
|
|
|
|
char *bl_desc;
|
|
|
|
|
AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc));
|
|
|
|
|
|
|
|
|
|
int n_references = 0;
|
|
|
|
|
int* levels = 0;
|
|
|
|
@ -1200,32 +1209,128 @@ int CloneTempProcess(void *returnValue)
|
|
|
|
|
{
|
|
|
|
|
char* refType;
|
|
|
|
|
tag_t refTag = references_tag[i];
|
|
|
|
|
AOM_ask_value_string(refTag, "object_type", &refType);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(refTag, "object_type", &refType));
|
|
|
|
|
if (strcmp(refType, "MEProcessRevision") == 0) {
|
|
|
|
|
hasProcess = true;
|
|
|
|
|
processTagTop = refTag;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int url_num = 0;
|
|
|
|
|
char** url_vals = NULL;
|
|
|
|
|
ITKCALL(PREF_ask_char_values("database_tc", &url_num, &url_vals));
|
|
|
|
|
string url = url_vals[0];
|
|
|
|
|
url.append("/").append(url_vals[2]);
|
|
|
|
|
|
|
|
|
|
//map<string,
|
|
|
|
|
printf("url ==> %s \n", url.c_str());
|
|
|
|
|
if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1)
|
|
|
|
|
{
|
|
|
|
|
printf("提示:中间数据表访问失败\n");
|
|
|
|
|
ifail = 1;
|
|
|
|
|
}
|
|
|
|
|
boolean isback = false;
|
|
|
|
|
tag_t meProcess = NULLTAG;
|
|
|
|
|
char *objName,*topId;
|
|
|
|
|
AOM_ask_value_string(designRev, "object_name", &objName);
|
|
|
|
|
AOM_ask_value_string(designRev, "item_id", &topId);
|
|
|
|
|
char* objName = NULL, * topId = NULL;
|
|
|
|
|
string backs = "";
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "object_name", &objName));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "item_id", &topId));
|
|
|
|
|
map<string, tag_t> mapByq;
|
|
|
|
|
//如果是产成品的话, 判断是否存在多个P物料
|
|
|
|
|
if (strstr(objName, "变压器") != NULL) {
|
|
|
|
|
//20240203备件包工艺路线指派
|
|
|
|
|
int back_num = 0;
|
|
|
|
|
char** back_vals = NULL, * group_name = NULL;
|
|
|
|
|
tag_t group = NULLTAG;
|
|
|
|
|
string tuhao;
|
|
|
|
|
vector<string> group_names;
|
|
|
|
|
ITKCALL(POM_ask_group(&group_name, &group));
|
|
|
|
|
Split(group_name, ".", group_names);
|
|
|
|
|
printf("group_name=======%s\n", group_names[0].c_str());
|
|
|
|
|
ITKCALL(PREF_ask_char_values("CHINT_PROCESS_RULE", &back_num, &back_vals));
|
|
|
|
|
//首选项格式:组名:匹配字段1;匹配字段2
|
|
|
|
|
for (int i = 0; i < back_num; i++) {
|
|
|
|
|
vector<string> group_backs;
|
|
|
|
|
Split(back_vals[i], ":", group_backs);
|
|
|
|
|
if (tc_strcmp(group_backs[0].c_str(), group_names[0].c_str()) == 0) {
|
|
|
|
|
vector<string> backs;
|
|
|
|
|
Split(group_backs[1], ";", backs);
|
|
|
|
|
for (int j = 0; j < backs.size(); j++) {
|
|
|
|
|
if (tc_strstr(objName, backs[j].c_str()) != NULL) {
|
|
|
|
|
tuhao = backs[j];
|
|
|
|
|
isback = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(isback)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isback) {
|
|
|
|
|
isback = false;
|
|
|
|
|
int b_refs = 0;
|
|
|
|
|
int* b_levels = 0;
|
|
|
|
|
tag_t* b_refs_tag = NULLTAG;
|
|
|
|
|
char** b_rel_name = NULL, * pcode = NULL;
|
|
|
|
|
string cpxh = "";
|
|
|
|
|
//判断当前物料对象是否在“产成品”文件夹(ZT2_ProjectFolder)中
|
|
|
|
|
ITKCALL(ITEM_ask_item_of_rev(designRev, &item_tag));
|
|
|
|
|
ITKCALL(WSOM_where_referenced2(item_tag, 1, &b_refs, &b_levels, &b_refs_tag, &b_rel_name));
|
|
|
|
|
for (int i = 0; i < b_refs; i++) {
|
|
|
|
|
char* ref_type = NULL;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(b_refs_tag[i], "object_type", &ref_type));
|
|
|
|
|
printf("ref_type:%s\n", ref_type);
|
|
|
|
|
if (tc_strcmp(ref_type, "ZT2_ProjectFolder") != 0)
|
|
|
|
|
continue;
|
|
|
|
|
int n_projs = 0;
|
|
|
|
|
tag_t* projs = NULLTAG;
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(b_refs_tag[i], "contents", &n_projs, &projs));
|
|
|
|
|
for (int j = 0; j < n_projs; j++) {
|
|
|
|
|
int n_drows = 0;
|
|
|
|
|
tag_t proj_rev = NULLTAG, * drows = NULLTAG;
|
|
|
|
|
ITKCALL(ITEM_ask_latest_rev(projs[j], &proj_rev));
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(proj_rev, "TC_Is_Represented_By", &n_drows, &drows));
|
|
|
|
|
printf("n_drows:%d\n", n_drows);
|
|
|
|
|
if (n_drows == 0)
|
|
|
|
|
continue;
|
|
|
|
|
ByqBean bean;
|
|
|
|
|
cpxh = getClassVal(drows[0], errorBuff, bean);
|
|
|
|
|
isback = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (isback)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
backs.append(cpxh).append("@").append(tuhao);
|
|
|
|
|
/*string sql = "select a.GYID from CHINT_WORKHOUR_WhProductXH a,CHINT_WORKHOUR_WhGYRule b ";
|
|
|
|
|
sql.append("where a.COMPANYCODE=b.COMPANYCODE and a.ProductZu=b.ProductZu ")
|
|
|
|
|
.append("and a.COMPANYCODE='").append(group_name)
|
|
|
|
|
.append("' and a.ProductXH='").append(cpxh)
|
|
|
|
|
.append("' and b.TuHao='").append(tuhao)
|
|
|
|
|
.append("'");
|
|
|
|
|
int outputColumn = 0, outputValueCount = 0;
|
|
|
|
|
char*** outputValue = NULL, sqlc[1024];
|
|
|
|
|
tc_strcpy(sqlc, sql.c_str());
|
|
|
|
|
QuerySQLNoInputParam(sqlc, &outputColumn, &outputValueCount, &outputValue);
|
|
|
|
|
if (outputValueCount > 0) {
|
|
|
|
|
gyid = outputValue[0][0];
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < outputValueCount; i++) {
|
|
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(objName, "变压器") != NULL) {
|
|
|
|
|
tag_t *topMatnrs,*pMaterials;
|
|
|
|
|
int num = 0, num2=0;
|
|
|
|
|
AOM_ask_value_tags(designRev, "TC_Is_Represented_By", &num, &topMatnrs);
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(designRev, "TC_Is_Represented_By", &num, &topMatnrs));
|
|
|
|
|
printf("num===>%d\n", num);
|
|
|
|
|
if (num >= 1) {
|
|
|
|
|
tag_t tzRev = topMatnrs[0];
|
|
|
|
|
AOM_ask_value_tags(tzRev, "representation_for", &num2, &pMaterials);
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(tzRev, "representation_for", &num2, &pMaterials));
|
|
|
|
|
for (int x = 0; x < num2; x++) {
|
|
|
|
|
char *pId,*zt2_ifpbom;
|
|
|
|
|
tag_t pMatr = pMaterials[x];
|
|
|
|
|
AOM_ask_value_string(pMatr, "item_id", &pId);
|
|
|
|
|
AOM_ask_value_string(pMatr, "zt2_ifpbom", &zt2_ifpbom);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(pMatr, "item_id", &pId));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(pMatr, "zt2_ifpbom", &zt2_ifpbom));
|
|
|
|
|
if (strcmp(pId, topId) != 0 && strcmp(zt2_ifpbom,"P")==0) {
|
|
|
|
|
tag_t process = getProcess(pMatr);
|
|
|
|
|
if (process != NULLTAG) {
|
|
|
|
@ -1263,31 +1368,19 @@ int CloneTempProcess(void *returnValue)
|
|
|
|
|
errorBuff = "当前选中的物料已经存在工艺路线.\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("mapByq===>%d\n", mapByq.size());
|
|
|
|
|
printf("mapByq===>%zd\n", mapByq.size());
|
|
|
|
|
if (hasProcess) {
|
|
|
|
|
errorBuff = "当前选中的物料已经存在工艺路线.\n";
|
|
|
|
|
}else if ((strcmp(bl_desc, "") == 0 || strstr(bl_desc,"-")==NULL)&& strstr(objName, "变压器") == NULL) {
|
|
|
|
|
}else if ((strcmp(bl_desc, "") == 0 || strstr(bl_desc,"-")==NULL) && strstr(objName, "变压器") == NULL && !isback) {
|
|
|
|
|
errorBuff = "当前选中的物料版本没有图号信息,请检查.\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
POM_AM__set_application_bypass(true);
|
|
|
|
|
int url_num = 0;
|
|
|
|
|
char** url_vals = NULL;
|
|
|
|
|
PREF_ask_char_values("database_tc", &url_num, &url_vals);
|
|
|
|
|
string url = url_vals[0];
|
|
|
|
|
url.append("/").append(url_vals[2]);
|
|
|
|
|
|
|
|
|
|
//map<string,
|
|
|
|
|
printf("url ==> %s \n", url.c_str());
|
|
|
|
|
if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1)
|
|
|
|
|
{
|
|
|
|
|
printf("提示:中间数据表访问失败\n");
|
|
|
|
|
ifail = 1;
|
|
|
|
|
}
|
|
|
|
|
tag_t topProcess = NULLTAG;
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
printf("errorBuff==>%s\n", errorBuff.c_str());
|
|
|
|
|
readProcessBom(bom_line, errorBuff, flag, topProcess, notTcmBuff);
|
|
|
|
|
readProcessBom(bom_line, errorBuff, flag, topProcess, notTcmBuff, backs);
|
|
|
|
|
if (topProcess != NULLTAG) {
|
|
|
|
|
map<string, tag_t>::iterator it;
|
|
|
|
|
for (it = mapByq.begin(); it != mapByq.end(); it++) {
|
|
|
|
@ -1296,18 +1389,18 @@ int CloneTempProcess(void *returnValue)
|
|
|
|
|
save_representation2(topProcess, matnrPrev, "IMAN_METarget");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DisConnServer();
|
|
|
|
|
if (!flag) {
|
|
|
|
|
errorBuff = "当前选中的PBOM没有实件,无需做工艺路线.";
|
|
|
|
|
}
|
|
|
|
|
POM_AM__set_application_bypass(false);
|
|
|
|
|
}
|
|
|
|
|
DisConnServer();
|
|
|
|
|
errorBuff.append(notTcmBuff);
|
|
|
|
|
if (errorBuff.empty()) {
|
|
|
|
|
errorBuff = "succ";
|
|
|
|
|
}
|
|
|
|
|
printf("errorBuff==>%s\n", errorBuff.c_str());
|
|
|
|
|
BOM_close_window(ebom_window);
|
|
|
|
|
ITKCALL(BOM_close_window(ebom_window));
|
|
|
|
|
*((char**)returnValue) = (char*)MEM_alloc((strlen(errorBuff.c_str()) + 1) * sizeof(char));
|
|
|
|
|
tc_strcpy(*((char**)returnValue), errorBuff.c_str());
|
|
|
|
|
return ifail;
|
|
|
|
|