|
|
@ -131,10 +131,12 @@ struct StBomBean {
|
|
|
|
vector<StBomBean> childs;
|
|
|
|
vector<StBomBean> childs;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
boolean isSt(tag_t matnr) {
|
|
|
|
0:外购;1:自制实体;2:自制虚拟
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int isSt(tag_t matnr) {
|
|
|
|
int cnt2, numFac, cnt3;
|
|
|
|
int cnt2, numFac, cnt3;
|
|
|
|
boolean flag = false;
|
|
|
|
int flag = 1;
|
|
|
|
char** procureType, ** factorys, ** specialProcureType,*objName;
|
|
|
|
char** procureType, ** factorys, ** specialProcureType,*objName;
|
|
|
|
ITKCALL(AOM_ask_value_strings(matnr, "zt2_SZSpecialProcuretype", &cnt3, &specialProcureType)); //为/
|
|
|
|
ITKCALL(AOM_ask_value_strings(matnr, "zt2_SZSpecialProcuretype", &cnt3, &specialProcureType)); //为/
|
|
|
|
ITKCALL(AOM_ask_value_strings(matnr, "zt2_SZProcuretype", &cnt2, &procureType)); //包含自制
|
|
|
|
ITKCALL(AOM_ask_value_strings(matnr, "zt2_SZProcuretype", &cnt2, &procureType)); //包含自制
|
|
|
@ -142,8 +144,14 @@ boolean isSt(tag_t matnr) {
|
|
|
|
//AOM_ask_value_string(matnr, "object_name",&objName);
|
|
|
|
//AOM_ask_value_string(matnr, "object_name",&objName);
|
|
|
|
for (int i = 0; i < numFac; i++) {
|
|
|
|
for (int i = 0; i < numFac; i++) {
|
|
|
|
if (tc_strcmp(factorys[i], "M060") == 0 && cnt2 > i && cnt3 > i) {
|
|
|
|
if (tc_strcmp(factorys[i], "M060") == 0 && cnt2 > i && cnt3 > i) {
|
|
|
|
if (tc_strstr(procureType[i], "自制") != NULL && tc_strcmp(specialProcureType[i], "/") == 0) {
|
|
|
|
if (tc_strstr(procureType[i], "外购") != NULL) {//自制
|
|
|
|
flag = true;
|
|
|
|
flag = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (tc_strcmp(specialProcureType[i], "/") == 0) {
|
|
|
|
|
|
|
|
flag = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
flag = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -162,28 +170,26 @@ void getBomMessage(vector<StBomBean>& stBomlines, tag_t cBomLine, StBomBean &pBe
|
|
|
|
char* cName = NULL, * zt2_SZProcuretype = NULL;
|
|
|
|
char* cName = NULL, * zt2_SZProcuretype = NULL;
|
|
|
|
ITKCALL(AOM_ask_value_tag(cBomLine, "bl_line_object", &cmantr));
|
|
|
|
ITKCALL(AOM_ask_value_tag(cBomLine, "bl_line_object", &cmantr));
|
|
|
|
ITKCALL(AOM_ask_value_string(cmantr, "object_name", &cName));
|
|
|
|
ITKCALL(AOM_ask_value_string(cmantr, "object_name", &cName));
|
|
|
|
ITKCALL(AOM_UIF_ask_value(cmantr, "zt2_SZProcuretype", &zt2_SZProcuretype)); //外购不再展开投料
|
|
|
|
//ITKCALL(AOM_UIF_ask_value(cmantr, "zt2_SZProcuretype", &zt2_SZProcuretype)); //外购不再展开投料
|
|
|
|
printf("虚拟件===>%s\n", cName);
|
|
|
|
printf("虚拟件===>%s\n", cName);
|
|
|
|
StBomBean bean;
|
|
|
|
StBomBean bean;
|
|
|
|
bean.bomline = cBomLine;
|
|
|
|
bean.bomline = cBomLine;
|
|
|
|
bean.currentName = cName;
|
|
|
|
bean.currentName = cName;
|
|
|
|
bean.flag = false;
|
|
|
|
bean.flag = false;
|
|
|
|
if (c_line_count > 0 && isSt(cmantr)) {
|
|
|
|
int f = isSt(cmantr);
|
|
|
|
bean.st = true;
|
|
|
|
//1、程序判断物料版本采购类型是什么,如果是外购,那么这个物料进行投料,有没有子件都一样处理
|
|
|
|
//stBomlines.push_back(bean);
|
|
|
|
//2、如果是自制,那么判断特殊采购类型,如果是虚拟,那么此物料不投料,继续展开BOM子件判断,如果没有子,那么此物料也算不需要投料的。如果是/,那么将此物料进行投料。
|
|
|
|
pBean.childs.push_back(bean);
|
|
|
|
if (f == 0 || f == 1) {
|
|
|
|
}
|
|
|
|
//外购和自制实体不看子级直接投本体
|
|
|
|
else if (c_line_count == 0) {
|
|
|
|
|
|
|
|
bean.st = true;
|
|
|
|
bean.st = true;
|
|
|
|
// stBomlines.push_back(bean);
|
|
|
|
|
|
|
|
pBean.childs.push_back(bean);
|
|
|
|
pBean.childs.push_back(bean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (tc_strcmp(zt2_SZProcuretype, "外购") != 0) {
|
|
|
|
else if (c_line_count > 0) {
|
|
|
|
|
|
|
|
//自制虚拟有子级就投子级
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
tag_t c_line_tag = c_line_tags[i];
|
|
|
|
tag_t c_line_tag = c_line_tags[i];
|
|
|
|
getBomMessage(stBomlines, c_line_tag, bean);
|
|
|
|
getBomMessage(stBomlines, c_line_tag, bean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// stBomlines.push_back(bean);
|
|
|
|
|
|
|
|
pBean.childs.push_back(bean);
|
|
|
|
pBean.childs.push_back(bean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -200,29 +206,26 @@ void getBomMessage(vector<StBomBean> &stBomlines, tag_t cBomLine) {
|
|
|
|
ITKCALL(AOM_ask_value_string(cBomLine, "object_string", &os));
|
|
|
|
ITKCALL(AOM_ask_value_string(cBomLine, "object_string", &os));
|
|
|
|
ITKCALL(AOM_ask_value_tag(cBomLine, "bl_line_object", &cmantr));
|
|
|
|
ITKCALL(AOM_ask_value_tag(cBomLine, "bl_line_object", &cmantr));
|
|
|
|
ITKCALL(AOM_ask_value_string(cmantr, "object_name", &cName));
|
|
|
|
ITKCALL(AOM_ask_value_string(cmantr, "object_name", &cName));
|
|
|
|
ITKCALL(AOM_UIF_ask_value(cmantr, "zt2_SZProcuretype", &zt2_SZProcuretype)); //外购不再展开投料
|
|
|
|
//ITKCALL(AOM_UIF_ask_value(cmantr, "zt2_SZProcuretype", &zt2_SZProcuretype)); //外购不再展开投料
|
|
|
|
printf("getBomMessage==>%s\n", os);
|
|
|
|
printf("getBomMessage==>%s\n", os);
|
|
|
|
StBomBean bean;
|
|
|
|
StBomBean bean;
|
|
|
|
bean.bomline = cBomLine;
|
|
|
|
bean.bomline = cBomLine;
|
|
|
|
bean.currentName = cName;
|
|
|
|
bean.currentName = cName;
|
|
|
|
if (c_line_count > 0 && isSt(cmantr)) {
|
|
|
|
int f = isSt(cmantr);
|
|
|
|
bean.st = true;
|
|
|
|
//1、程序判断物料版本采购类型是什么,如果是外购,那么这个物料进行投料,有没有子件都一样处理
|
|
|
|
stBomlines.push_back(bean);
|
|
|
|
//2、如果是自制,那么判断特殊采购类型,如果是虚拟,那么此物料不投料,继续展开BOM子件判断,如果没有子,那么此物料也算不需要投料的。如果是/,那么将此物料进行投料。
|
|
|
|
}
|
|
|
|
if (f == 0 || f == 1) {
|
|
|
|
else if (c_line_count == 0) {
|
|
|
|
//外购和自制实体不看子级直接投本体
|
|
|
|
bean.st = true;
|
|
|
|
bean.st = true;
|
|
|
|
stBomlines.push_back(bean);
|
|
|
|
stBomlines.push_back(bean);
|
|
|
|
//printf("st = true===>%s\n", cName);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (tc_strcmp(zt2_SZProcuretype, "外购") != 0) {
|
|
|
|
else if (c_line_count > 0) {
|
|
|
|
//虚拟件向下展开 //实体件直接投料
|
|
|
|
//自制虚拟有子级就投子级
|
|
|
|
printf("虚拟件============>%s\n", cName);
|
|
|
|
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
for (int i = 0; i < c_line_count; i++) {
|
|
|
|
tag_t c_line_tag = c_line_tags[i];
|
|
|
|
tag_t c_line_tag = c_line_tags[i];
|
|
|
|
getBomMessage(stBomlines, c_line_tag, bean);
|
|
|
|
getBomMessage(stBomlines, c_line_tag, bean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stBomlines.push_back(bean);
|
|
|
|
stBomlines.push_back(bean);
|
|
|
|
printf("虚拟件===========>%zd\n", bean.childs.size());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//虚拟向下展开,实体投料
|
|
|
|
//虚拟向下展开,实体投料
|
|
|
@ -688,7 +691,7 @@ void readPbomMsg(tag_t bom_line, string &errBuffer, map<string, vector<FeedRule>
|
|
|
|
ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &rev));
|
|
|
|
ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &rev));
|
|
|
|
ITKCALL(AOM_ask_value_string(rev, "item_id", &id));
|
|
|
|
ITKCALL(AOM_ask_value_string(rev, "item_id", &id));
|
|
|
|
ITKCALL(AOM_ask_value_string(rev, "object_name", &objName));
|
|
|
|
ITKCALL(AOM_ask_value_string(rev, "object_name", &objName));
|
|
|
|
if (c_line_count > 0 && (isSt(rev) || tc_strstr(objName, "变压器") != NULL || isback)) {
|
|
|
|
if (c_line_count > 0 && (isSt(rev) == 1 || tc_strstr(objName, "变压器") != NULL || isback)) {
|
|
|
|
auto start = std::chrono::high_resolution_clock::now();
|
|
|
|
auto start = std::chrono::high_resolution_clock::now();
|
|
|
|
|
|
|
|
|
|
|
|
int n_references = 0;
|
|
|
|
int n_references = 0;
|
|
|
|