|
|
#include "util.h"
|
|
|
|
|
|
void save_judge(tag_t top, string &check, string &name, vector<string> &type_vec, vector<string> &quantity_type_vec, stringstream &ss, stringstream &status_ss)
|
|
|
{
|
|
|
int line_cnt;
|
|
|
tag_t *lines;
|
|
|
BOM_line_ask_child_lines(top, &line_cnt, &lines);
|
|
|
char *val;
|
|
|
for (int i = 0; i < line_cnt; i++)
|
|
|
{
|
|
|
AOM_ask_value_string(lines[i], "bl_item_object_type", &val);
|
|
|
printf("type :%s\n", val);
|
|
|
if (find(type_vec.begin(), type_vec.end(), val) != type_vec.end())
|
|
|
continue;
|
|
|
if (find(quantity_type_vec.begin(), quantity_type_vec.end(), val) != quantity_type_vec.end())
|
|
|
{
|
|
|
char *test;
|
|
|
AOM_ask_value_string(lines[i], "JD2_SFHL", &test);
|
|
|
printf("JD2_SFHL:%s\n", test);
|
|
|
if(tc_strcmp(test,"1")==0)
|
|
|
AOM_ask_value_string(lines[i], "JD2_sl", &val);
|
|
|
else
|
|
|
AOM_ask_value_string(lines[i], "bl_quantity", &val);
|
|
|
if (tc_strlen(val) == 0)
|
|
|
{
|
|
|
AOM_ask_value_string(lines[i], "bl_rev_object_string", &val);
|
|
|
|
|
|
ss << val << ",";
|
|
|
}
|
|
|
}
|
|
|
AOM_UIF_ask_value(lines[i], "jd2_last_release_status", &val);
|
|
|
string temp = val;
|
|
|
printf("length:%llu status:%s\n", temp.length(), val);
|
|
|
|
|
|
if (temp.length() == 0 || check.find(temp) != -1)
|
|
|
{
|
|
|
AOM_ask_value_string(lines[i], "bl_rev_object_string", &val);
|
|
|
status_ss << val << ",";
|
|
|
}
|
|
|
save_judge(lines[i], check, name, type_vec, quantity_type_vec, ss,status_ss);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
int bs_bom_save_check(METHOD_message_t *msg, va_list args)
|
|
|
{
|
|
|
printf("bs_bom_save_check start11\n");
|
|
|
|
|
|
logical is_judge = false;
|
|
|
PREF_ask_logical_value("connor_bom_check", 0, &is_judge);
|
|
|
if (!is_judge)
|
|
|
return ITK_ok;
|
|
|
int ifail = ITK_ok, num;
|
|
|
|
|
|
//»ñÈ¡ÊôÐÔ¶ÔÏó
|
|
|
tag_t win = va_arg(args, tag_t), top;
|
|
|
char *check_val, **type_val, **quantity_type;
|
|
|
string name, check;
|
|
|
stringstream ss,status_ss;
|
|
|
int type_cnt, quantity_type_cnt;
|
|
|
PREF_ask_char_value("connor_bom_check_value", 0, &check_val);
|
|
|
PREF_ask_char_values("connor_bom_check_type", &type_cnt, &type_val);
|
|
|
PREF_ask_char_values("connor_bom_quantity_check_type", &quantity_type_cnt, &quantity_type);
|
|
|
|
|
|
vector<string> type_vec(type_val, type_val + type_cnt), quantity_type_vec(quantity_type, quantity_type + quantity_type_cnt);
|
|
|
|
|
|
check = check_val;
|
|
|
BOM_ask_window_top_line(win, &top);
|
|
|
save_judge(top, check, name, type_vec, quantity_type_vec, ss, status_ss);
|
|
|
if (ss.str().length())
|
|
|
{
|
|
|
ss << "ÎïÁÏÊýÁ¿Îª¿Õ£¬ÇëÌîд£¡\n";
|
|
|
ifail = 1;
|
|
|
}
|
|
|
if (status_ss.str().length()) {
|
|
|
ss << status_ss.str() << "¶ÔÏóΪ¶³½á״̬»òδ·¢²¼£¬²»Äܱ£´æBOM!\n";
|
|
|
ifail = 1;
|
|
|
}
|
|
|
if (ss.str().length())
|
|
|
EMH_store_error_s1(EMH_severity_user_error, EMH_PROP_error_base, ss.str().c_str());
|
|
|
|
|
|
printf("bs_bom_save_check end11\n");
|
|
|
|
|
|
return ifail;
|
|
|
}
|
|
|
|