|
|
|
@ -115,25 +115,29 @@ string& replace_all2(string& str, const string& old_value, const string& new_v
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean& bean) {
|
|
|
|
|
auto start = std::chrono::high_resolution_clock::now();
|
|
|
|
|
int num = 0;
|
|
|
|
|
tag_t* mantrs;
|
|
|
|
|
char *type, *item_id;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "object_type", &type));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "item_id", &item_id));
|
|
|
|
|
if (strcmp(type, "Part Revision") == 0) {
|
|
|
|
|
if (tc_strcmp(type, "Part Revision") == 0) {
|
|
|
|
|
return designRev;
|
|
|
|
|
}
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(designRev, "representation_for", &num, &mantrs));
|
|
|
|
|
//printf("num===>%d\n", num);
|
|
|
|
|
vector<tag_t> parts;
|
|
|
|
|
if (strstr(item_id, "1ZDB300000P") != NULL) {
|
|
|
|
|
auto bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
std::chrono::duration<double> elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart1:%f\n", elapsed.count());
|
|
|
|
|
if (tc_strstr(item_id, "1ZDB300000P") != NULL) {
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(designRev, "representation_for", &num, &mantrs));
|
|
|
|
|
map<string, tag_t> partsCcp;
|
|
|
|
|
for (int i = 0; i < num; i++) {
|
|
|
|
|
char* type, *zt2_ifpbom, *itemId;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "object_type", &type));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "zt2_ifpbom", &zt2_ifpbom));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "item_id", &itemId));
|
|
|
|
|
if (strstr(type, "Part") != NULL && strcmp(zt2_ifpbom, "P") != 0) { //
|
|
|
|
|
if (tc_strstr(type, "Part") != NULL && tc_strcmp(zt2_ifpbom, "P") != 0) { //
|
|
|
|
|
tag_t matnrItem;
|
|
|
|
|
ITKCALL(ITEM_ask_item_of_rev(mantrs[i], &matnrItem));
|
|
|
|
|
partsCcp[itemId] = matnrItem;
|
|
|
|
@ -147,6 +151,10 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart1num%d:%f\n", num, elapsed.count());
|
|
|
|
|
|
|
|
|
|
map<string, tag_t>::iterator it;
|
|
|
|
|
for (it = partsCcp.begin(); it != partsCcp.end(); it++) {
|
|
|
|
|
string s = it->first;
|
|
|
|
@ -160,20 +168,27 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
bean.ccps.push_back(partRevLast);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart1it%zd:%f\n", partsCcp.size(), elapsed.count());
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else if (tc_strstr(item_id, "2ZDB") == NULL) {
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(designRev, "representation_for", &num, &mantrs));
|
|
|
|
|
map<string, tag_t> partsCcp;
|
|
|
|
|
for (int i = 0; i < num; i++) {
|
|
|
|
|
char* type, *zt2_ifpbom, *itemId;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "object_type", &type));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "zt2_ifpbom", &zt2_ifpbom));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "item_id", &itemId));
|
|
|
|
|
if (strstr(type, "Part") != NULL && strcmp(zt2_ifpbom, "P") != 0) { //
|
|
|
|
|
if (tc_strstr(type, "Part") != NULL && tc_strcmp(zt2_ifpbom, "P") != 0) { //
|
|
|
|
|
tag_t matnrItem;
|
|
|
|
|
ITKCALL(ITEM_ask_item_of_rev(mantrs[i], &matnrItem));
|
|
|
|
|
partsCcp[itemId] = matnrItem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart2num%d:%f\n", num, elapsed.count());
|
|
|
|
|
map<string, tag_t>::iterator it;
|
|
|
|
|
for (it = partsCcp.begin(); it != partsCcp.end(); it++) {
|
|
|
|
|
string s = it->first;
|
|
|
|
@ -183,6 +198,9 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
//}
|
|
|
|
|
parts.push_back(partRevLast);
|
|
|
|
|
}
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart2it%zd:%f\n", partsCcp.size(), elapsed.count());
|
|
|
|
|
}
|
|
|
|
|
if (parts.size() == 1) {
|
|
|
|
|
return parts[0];
|
|
|
|
@ -200,7 +218,11 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
//}
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRevLine, "ZT2_TYSpecifications", &zt2_TYJNo));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "zt2_Specifications", &spec));
|
|
|
|
|
if (strcmp(zt2_TYJNo, "") != 0) {
|
|
|
|
|
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart2:%f\n", elapsed.count());
|
|
|
|
|
if (tc_strcmp(zt2_TYJNo, "") != 0) {
|
|
|
|
|
string qryVal;
|
|
|
|
|
tag_t query = NULLTAG, *tags;
|
|
|
|
|
map<string, tag_t> map_revs;
|
|
|
|
@ -219,6 +241,7 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
map_revs[zt2_MaterialNo] = rev;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vector<string> keySet = KeySet(map_revs);
|
|
|
|
|
sort(keySet.begin(), keySet.end(), myCompare);
|
|
|
|
|
for (int i = 0; i < keySet.size(); i++) {
|
|
|
|
@ -238,7 +261,11 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
if (vals[k].rfind("F064:", 0) == 0) {
|
|
|
|
|
string temp = replace_all2(vals[k], "F064:", "");
|
|
|
|
|
printf("temp===>%s\n", temp.c_str());
|
|
|
|
|
if (strstr(zt2_TYJNo, temp.c_str()) != NULL) {
|
|
|
|
|
if (tc_strstr(zt2_TYJNo, temp.c_str()) != NULL) {
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart3:%f\n", elapsed.count());
|
|
|
|
|
|
|
|
|
|
return map_revs[materialNo];
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -246,7 +273,7 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!strcmp(zt2_Diagram, "Y") == 0 && !strcmp(zt2_Diagram, "是") == 0) {
|
|
|
|
|
if (!tc_strcmp(zt2_Diagram, "Y") == 0 && !tc_strcmp(zt2_Diagram, "是") == 0) {
|
|
|
|
|
string buffErr = "";
|
|
|
|
|
buffErr.append("缺少物料编码[找不到与通用件规格相匹配的物料-(*").append(searchId)
|
|
|
|
|
.append("*").append(zt2_TYJNo).append(")];\n");
|
|
|
|
@ -258,11 +285,41 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tc_strstr(item_id, "2ZDB") != NULL) {
|
|
|
|
|
ITKCALL(AOM_ask_value_tags(designRev, "representation_for", &num, &mantrs));
|
|
|
|
|
map<string, tag_t> partsCcp;
|
|
|
|
|
for (int i = 0; i < num; i++) {
|
|
|
|
|
char* type, *zt2_ifpbom, *itemId;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "object_type", &type));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "zt2_ifpbom", &zt2_ifpbom));
|
|
|
|
|
ITKCALL(AOM_ask_value_string(mantrs[i], "item_id", &itemId));
|
|
|
|
|
if (tc_strstr(type, "Part") != NULL && tc_strcmp(zt2_ifpbom, "P") != 0) { //
|
|
|
|
|
tag_t matnrItem;
|
|
|
|
|
ITKCALL(ITEM_ask_item_of_rev(mantrs[i], &matnrItem));
|
|
|
|
|
partsCcp[itemId] = matnrItem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart2num%d:%f\n", num, elapsed.count());
|
|
|
|
|
map<string, tag_t>::iterator it;
|
|
|
|
|
for (it = partsCcp.begin(); it != partsCcp.end(); it++) {
|
|
|
|
|
string s = it->first;
|
|
|
|
|
tag_t partLast = partsCcp[s], partRevLast;
|
|
|
|
|
ITKCALL(ITEM_ask_latest_rev(partLast, &partRevLast));
|
|
|
|
|
//if (parts.size() == 0) {
|
|
|
|
|
//}
|
|
|
|
|
parts.push_back(partRevLast);
|
|
|
|
|
}
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart2it%zd:%f\n", partsCcp.size(), elapsed.count());
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < parts.size(); i++) {
|
|
|
|
|
tag_t part = parts[i];
|
|
|
|
|
char* specPart;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(part, "zt2_Specifications", &specPart));
|
|
|
|
|
if (strcmp(specPart, spec) == 0) {
|
|
|
|
|
if (tc_strcmp(specPart, spec) == 0) {
|
|
|
|
|
return part;
|
|
|
|
|
}
|
|
|
|
|
/*String spec2 = parts.get(i).getProperty("zt2_Specifications");
|
|
|
|
@ -270,7 +327,10 @@ tag_t getSapPart(tag_t designRevLine, tag_t designRev, string& errBuff, NodeBean
|
|
|
|
|
return parts.get(i);
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
if (!strcmp(zt2_Diagram, "Y") == 0 && !strcmp(zt2_Diagram, "是") == 0) {
|
|
|
|
|
bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart4:%f\n", elapsed.count());
|
|
|
|
|
if (!tc_strcmp(zt2_Diagram, "Y") == 0 && !tc_strcmp(zt2_Diagram, "是") == 0) {
|
|
|
|
|
//errBuff.append("缺少物料编码[找不到相同规格的物料(").append(spec).append(")];");
|
|
|
|
|
string buffErr = "";
|
|
|
|
|
buffErr.append("缺少物料编码[找不到相同规格的物料(").append(spec).append(")];");
|
|
|
|
@ -398,7 +458,11 @@ void askLineVal(NodeBean& bean, tag_t bom_line, tag_t designRev, string& errBuff
|
|
|
|
|
bean.bl_sequence_no = bl_sequence_no;
|
|
|
|
|
}
|
|
|
|
|
//根据图纸获取物料 包含通用件的逻辑
|
|
|
|
|
auto start = std::chrono::high_resolution_clock::now();
|
|
|
|
|
tag_t part = getSapPart(bom_line, designRev, errBuff, bean);
|
|
|
|
|
auto bomtime = std::chrono::high_resolution_clock::now();
|
|
|
|
|
std::chrono::duration<double> elapsed = bomtime - start;
|
|
|
|
|
printf("getSapPart:%f\n", elapsed.count());
|
|
|
|
|
//printf("11111111\n");
|
|
|
|
|
if (part != NULLTAG) {
|
|
|
|
|
//BOM_writer
|
|
|
|
@ -569,14 +633,12 @@ void getAllXnj(vector<tag_t> xnzjbVec, int maxNum, int &xxt,
|
|
|
|
|
* @param dbName 原材料展开数据库信息
|
|
|
|
|
* @param loginUserId 用户信息
|
|
|
|
|
*/
|
|
|
|
|
void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName, char *loginUserId)
|
|
|
|
|
void recyReadBom(tag_t bom_line, tag_t designRev, NodeBean& pBean, string& errBuff, string dbName, char *loginUserId)
|
|
|
|
|
{
|
|
|
|
|
int c_line_count;
|
|
|
|
|
char* uid, *type, *zt2_Diagram, *source, *itemId, *object_name;
|
|
|
|
|
//图纸版本、子行
|
|
|
|
|
tag_t designRev, *c_line_tags;
|
|
|
|
|
ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &designRev));
|
|
|
|
|
//printf("1222");
|
|
|
|
|
int c_line_count = 0;
|
|
|
|
|
char *itemId = NULL, *uid = NULL, *type = NULL, *zt2_Diagram = NULL, *source = NULL, *object_name = NULL, *os = NULL;
|
|
|
|
|
tag_t *c_line_tags;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "item_id", &itemId));
|
|
|
|
|
ITK__convert_tag_to_uid(designRev, &uid);
|
|
|
|
|
//printf("revUid===>%s\n", uid);
|
|
|
|
|
pBean.revUid = uid;
|
|
|
|
@ -603,9 +665,6 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean flagMat = false;
|
|
|
|
|
//根据图纸获取物料信息
|
|
|
|
|
askLineVal(pBean, bom_line, designRev, errBuff, flagMat);
|
|
|
|
|
tag_t tagUser;
|
|
|
|
|
char *tagId;
|
|
|
|
|
ITKCALL(AOM_ask_value_tag(designRev, "owning_user", &tagUser));
|
|
|
|
@ -618,30 +677,41 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
if (strcmp(type, "ZT2_XNZJBRevision") == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//外购 不展开子件
|
|
|
|
|
if (strstr(itemId, "2ZD") != NULL || strstr(itemId, "4ZD") != NULL) {
|
|
|
|
|
if (!flagMat) {
|
|
|
|
|
pBean.isOutBuy = true;
|
|
|
|
|
return;
|
|
|
|
|
if (bom_line != NULLTAG) {
|
|
|
|
|
//图纸版本、子行
|
|
|
|
|
ITKCALL(AOM_ask_value_string(bom_line, "object_string", &os));
|
|
|
|
|
//ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &designRev));
|
|
|
|
|
//printf("1222");
|
|
|
|
|
|
|
|
|
|
boolean flagMat = false;
|
|
|
|
|
//根据图纸获取物料信息
|
|
|
|
|
askLineVal(pBean, bom_line, designRev, errBuff, flagMat);
|
|
|
|
|
//外购 不展开子件
|
|
|
|
|
if (strstr(itemId, "2ZD") != NULL || strstr(itemId, "4ZD") != NULL) {
|
|
|
|
|
if (!flagMat) {
|
|
|
|
|
pBean.isOutBuy = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (strstr(itemId, "1ZD") != NULL) {
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "zt2_Source", &source));
|
|
|
|
|
if (strcmp(source, "S2") == 0 || strcmp(source, "外购") == 0) {
|
|
|
|
|
pBean.isOutBuy = true;
|
|
|
|
|
return;
|
|
|
|
|
if (strstr(itemId, "1ZD") != NULL) {
|
|
|
|
|
ITKCALL(AOM_ask_value_string(designRev, "zt2_Source", &source));
|
|
|
|
|
if (strcmp(source, "S2") == 0 || strcmp(source, "外购") == 0) {
|
|
|
|
|
pBean.isOutBuy = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags));
|
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
|
/*ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags));
|
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
|
logical flag;
|
|
|
|
|
ITKCALL(BOM_line_is_packed(c_line_tags[i], &flag));
|
|
|
|
|
if (flag) {
|
|
|
|
|
ITKCALL(BOM_line_unpack(c_line_tags[i]));
|
|
|
|
|
ITKCALL(BOM_line_unpack(c_line_tags[i]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AOM_refresh(bom_line, FALSE);*/
|
|
|
|
|
ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags));
|
|
|
|
|
}
|
|
|
|
|
AOM_refresh(bom_line, FALSE);*/
|
|
|
|
|
ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags));
|
|
|
|
|
|
|
|
|
|
//转换时原材料展开逻辑
|
|
|
|
|
if (c_line_count == 0 && !dbName.empty() && (strstr(itemId, "1ZD") != NULL ||
|
|
|
|
|
strstr(itemId, "2ZD") != NULL || strstr(itemId, "4ZD") != NULL)) {
|
|
|
|
@ -664,7 +734,6 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
if (found == std::string::npos) {
|
|
|
|
|
errBuff.append(buffErr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (int t = 0; t < outputValueCount1; t++) {
|
|
|
|
|
string materialno = outputValue1[t][0];
|
|
|
|
@ -698,13 +767,13 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
if (suppressed) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
char* os = NULL;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(c_line_tags[i], "object_string", &os));
|
|
|
|
|
char* os2 = NULL;
|
|
|
|
|
ITKCALL(AOM_ask_value_string(c_line_tags[i], "object_string", &os2));
|
|
|
|
|
//修改过之后之前已经是解包的状态了
|
|
|
|
|
logical flag;
|
|
|
|
|
char *remark;
|
|
|
|
|
ITKCALL(BOM_line_is_packed(c_line_tags[i], &flag));
|
|
|
|
|
printf("flag1=%d==>%s\n", flag, os);
|
|
|
|
|
printf("flag1=%d==>%s\n", flag, os2);
|
|
|
|
|
ITKCALL(AOM_ask_value_string(c_line_tags[i], "ZT2_Remark", &remark));
|
|
|
|
|
//printf("recyReadBom:%s\n", remark);
|
|
|
|
|
if (flag) {
|
|
|
|
@ -747,7 +816,7 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
cBean.packNum = count + 1;
|
|
|
|
|
cBean.topNum = atoi(topNum);
|
|
|
|
|
cBean.remark = remark;
|
|
|
|
|
recyReadBom(c_line_tags[i], cBean, errBuff, dbName, loginUserId);
|
|
|
|
|
recyReadBom(c_line_tags[i], c_Rev, cBean, errBuff, dbName, loginUserId);
|
|
|
|
|
pBean.childs.push_back(cBean);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -782,7 +851,7 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
cBean.revUid = cUid;
|
|
|
|
|
cBean.designRev = c_Rev;
|
|
|
|
|
cBean.remark = remark;
|
|
|
|
|
recyReadBom(c_line_tags[i], cBean, errBuff, dbName, loginUserId);
|
|
|
|
|
recyReadBom(c_line_tags[i], c_Rev, cBean, errBuff, dbName, loginUserId);
|
|
|
|
|
pBean.childs.push_back(cBean);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -800,7 +869,7 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
* @param dbName 原材料展开的数据表
|
|
|
|
|
* @param idVector 需要D转E的BOM类别
|
|
|
|
|
*/
|
|
|
|
|
void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName, vector<string> idVector)
|
|
|
|
|
void recyReadBom2(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName, vector<string> idVector)
|
|
|
|
|
{
|
|
|
|
|
int c_line_count;
|
|
|
|
|
char* uid, *type, *zt2_Diagram, *source, *itemId, *object_name;
|
|
|
|
@ -967,7 +1036,7 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
cBean.packNum = count + 1;
|
|
|
|
|
cBean.topNum = atoi(topNum);
|
|
|
|
|
cBean.remark = remark;
|
|
|
|
|
recyReadBom(c_line_tags[i], cBean, errBuff, dbName, idVector);
|
|
|
|
|
recyReadBom2(c_line_tags[i], cBean, errBuff, dbName, idVector);
|
|
|
|
|
pBean.childs.push_back(cBean);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -993,7 +1062,7 @@ void recyReadBom(tag_t bom_line, NodeBean& pBean, string& errBuff, string dbName
|
|
|
|
|
cBean.revUid = cUid;
|
|
|
|
|
cBean.designRev = c_Rev;
|
|
|
|
|
cBean.remark = remark;
|
|
|
|
|
recyReadBom(c_line_tags[i], cBean, errBuff, dbName, idVector);
|
|
|
|
|
recyReadBom2(c_line_tags[i], cBean, errBuff, dbName, idVector);
|
|
|
|
|
pBean.childs.push_back(cBean);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1064,7 +1133,7 @@ void getAllXnj(vector<tag_t> xnzjbVec, int maxNum, int &xxt,
|
|
|
|
|
xxt = xxt + 1;
|
|
|
|
|
cBean.bl_sequence_no = lastnum;
|
|
|
|
|
cBean.remark = remark;
|
|
|
|
|
recyReadBom(cc_line_tags[j], cBean, errBuff, dbName, idVector);
|
|
|
|
|
recyReadBom2(cc_line_tags[j], cBean, errBuff, dbName, idVector);
|
|
|
|
|
pBean.childs.push_back(cBean);
|
|
|
|
|
}
|
|
|
|
|
printf("xnzjbVec2 ===> %d ==>%d \n", xnzjbVec2.size(), qtyPXn);
|
|
|
|
@ -1135,7 +1204,7 @@ void getAllXnj(vector<tag_t> xnzjbVec, int maxNum, int &xxt,
|
|
|
|
|
cBean.bl_sequence_no = lastnum;
|
|
|
|
|
cBean.remark = remark;
|
|
|
|
|
//非虚拟件的继续原逻辑展开
|
|
|
|
|
recyReadBom(cc_line_tags[j], cBean, errBuff, dbName, loginUserId);
|
|
|
|
|
recyReadBom(cc_line_tags[j], c_Rev, cBean, errBuff, dbName, loginUserId);
|
|
|
|
|
pBean.childs.push_back(cBean);
|
|
|
|
|
}
|
|
|
|
|
printf("xnzjbVec2 ===> %d ==>%d \n", xnzjbVec2.size(), qtyPXn);
|
|
|
|
@ -1642,9 +1711,10 @@ int DbomToEMethod(void* returnValue) {
|
|
|
|
|
tag_t* bvr_list = NULL;
|
|
|
|
|
ITKCALL(ITEM_rev_list_bom_view_revs(designRev, &bvr_count, &bvr_list));
|
|
|
|
|
printf("bvr_count=%d", bvr_count);
|
|
|
|
|
|
|
|
|
|
ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
printf("顶层bom获取\n");
|
|
|
|
|
if (bvr_count > 0) {
|
|
|
|
|
ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //顶层bom获取
|
|
|
|
|
printf("顶层bom获取\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags));
|
|
|
|
|
NodeBean topBean;
|
|
|
|
@ -1683,7 +1753,7 @@ int DbomToEMethod(void* returnValue) {
|
|
|
|
|
printf("dbName===%s\n", dbName.c_str());
|
|
|
|
|
ITKCALL(POM_get_user_id(&loginUserId));
|
|
|
|
|
|
|
|
|
|
recyReadBom(bom_line, topBean, errBuff, dbName, loginUserId);
|
|
|
|
|
recyReadBom(bom_line, designRev, topBean, errBuff, dbName, loginUserId);
|
|
|
|
|
DisConnServer();
|
|
|
|
|
ITKCALL(BOM_close_window(ebom_window));
|
|
|
|
|
auto time2 = std::chrono::high_resolution_clock::now();
|
|
|
|
@ -1882,7 +1952,7 @@ int DbomToEMethodUser(void* returnValue) {
|
|
|
|
|
elapsed = time1 - start;
|
|
|
|
|
printf("time1:%f\n", elapsed.count());
|
|
|
|
|
|
|
|
|
|
recyReadBom(bom_line, topBean, errBuff, dbName, idVector);
|
|
|
|
|
recyReadBom2(bom_line, topBean, errBuff, dbName, idVector);
|
|
|
|
|
auto time2 = std::chrono::high_resolution_clock::now();
|
|
|
|
|
elapsed = time2 - start;
|
|
|
|
|
printf("time2:%f\n", elapsed.count());
|
|
|
|
|