|
|
|
@ -1,5 +1,43 @@
|
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
|
|
void judge_tag(tag_t tag,int index,vector<string> &vec,stringstream &name)
|
|
|
|
|
{
|
|
|
|
|
if(index==vec.size()-1)
|
|
|
|
|
{
|
|
|
|
|
char *val,*type;
|
|
|
|
|
AOM_ask_value_string(tag, "object_type", &type);
|
|
|
|
|
printf("vec type:%s last type:%s\n",vec[index].c_str(), type);
|
|
|
|
|
if (vec[index] != type)
|
|
|
|
|
return;
|
|
|
|
|
int rel_cnt;
|
|
|
|
|
tag_t *rels;
|
|
|
|
|
AOM_ask_value_tags(tag, "release_status_list", &rel_cnt, &rels);
|
|
|
|
|
if (rel_cnt == 0)
|
|
|
|
|
{
|
|
|
|
|
AOM_ask_value_string(tag, "object_string", &val);
|
|
|
|
|
name << val << ",";
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(vec[index]=="Latest")
|
|
|
|
|
{
|
|
|
|
|
tag_t rev;
|
|
|
|
|
ITEM_ask_latest_rev(tag, &rev);
|
|
|
|
|
if(rev)
|
|
|
|
|
judge_tag(rev, index + 1, vec, name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
int tag_cnt;
|
|
|
|
|
tag_t *tags;
|
|
|
|
|
AOM_ask_value_tags(tag, vec[index].c_str(), &tag_cnt, &tags);
|
|
|
|
|
for(auto i=0;i<tag_cnt;i++)
|
|
|
|
|
{
|
|
|
|
|
judge_tag(tags[i], index + 1, vec, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int bs_test_release_check(EPM_rule_message_t msg)
|
|
|
|
|
{
|
|
|
|
|
int ifail = EPM_go, att_count, tag_cnt, rel_cnt;
|
|
|
|
@ -12,62 +50,34 @@ int bs_test_release_check(EPM_rule_message_t msg)
|
|
|
|
|
int arg_cnt = TC_number_of_arguments(arguments), status = 0;
|
|
|
|
|
|
|
|
|
|
stringstream name;
|
|
|
|
|
map<string, string> paras;
|
|
|
|
|
// map<string, string> paras;
|
|
|
|
|
map<string, vector<string>> judge_map;
|
|
|
|
|
for (auto i = 0; i<arg_cnt; i++)
|
|
|
|
|
{
|
|
|
|
|
char *temp_key, *temp_val;
|
|
|
|
|
ITK_ask_argument_named_value(TC_next_argument(arguments), &temp_key, &temp_val);
|
|
|
|
|
paras[temp_key] = temp_val;
|
|
|
|
|
// paras[temp_key] = temp_val;
|
|
|
|
|
vector<string> temp;
|
|
|
|
|
split(temp_val, ".", &temp);
|
|
|
|
|
if(temp.size())
|
|
|
|
|
judge_map[temp[0]] = temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i<att_count; i++)
|
|
|
|
|
{
|
|
|
|
|
bool pass = true;
|
|
|
|
|
if(!isTypeOf(attachments[i],"JD2_GTSYWTSRevision"))
|
|
|
|
|
char *type;
|
|
|
|
|
AOM_ask_value_string(attachments[i], "object_type", &type);
|
|
|
|
|
printf("type:%s\n", type);
|
|
|
|
|
if(judge_map.find(type)!=judge_map.end())
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
judge_tag(attachments[i], 1, judge_map[type], name);
|
|
|
|
|
}
|
|
|
|
|
AOM_ask_value_tags(attachments[i], "JD2_CSJH", &tag_cnt, &tags);
|
|
|
|
|
for(int j=0;j<tag_cnt;j++)
|
|
|
|
|
{
|
|
|
|
|
int tag_cnt2;
|
|
|
|
|
tag_t *tags2,temp_tag;
|
|
|
|
|
ITEM_ask_latest_rev(tags[j], &temp_tag);
|
|
|
|
|
AOM_ask_value_tags(temp_tag, "JD2_CSBG", &tag_cnt2, &tags2);
|
|
|
|
|
printf("release check1\n");
|
|
|
|
|
|
|
|
|
|
for(int k=0;k<tag_cnt2;k++)
|
|
|
|
|
{
|
|
|
|
|
ITEM_ask_latest_rev(tags2[k], &tag);
|
|
|
|
|
AOM_ask_value_tags(tag, "release_status_list", &rel_cnt, &rels);
|
|
|
|
|
if (rel_cnt == 0)
|
|
|
|
|
{
|
|
|
|
|
AOM_ask_value_string(tag, "object_string", &val);
|
|
|
|
|
name << val << ",";
|
|
|
|
|
ifail = EPM_nogo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AOM_ask_value_tags(temp_tag, "JD2_CSBGHZ", &tag_cnt2, &tags2);
|
|
|
|
|
printf("release check2\n");
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k<tag_cnt2; k++)
|
|
|
|
|
{
|
|
|
|
|
ITEM_ask_latest_rev(tags2[k], &tag);
|
|
|
|
|
AOM_ask_value_tags(tag, "release_status_list", &rel_cnt, &rels);
|
|
|
|
|
if (rel_cnt == 0)
|
|
|
|
|
{
|
|
|
|
|
AOM_ask_value_string(tag, "object_string", &val);
|
|
|
|
|
name << val << ",";
|
|
|
|
|
if (name.str().length()) {
|
|
|
|
|
ifail = EPM_nogo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (ifail == EPM_nogo) {
|
|
|
|
|
name <<"未发布,请先审核发布!";
|
|
|
|
|
EMH_store_error_s1(EMH_severity_user_error, EMH_PROP_error_base, name.str().c_str());
|
|
|
|
|
}
|
|
|
|
|