|
|
#include "updateMaterial.h"
|
|
|
|
|
|
|
|
|
void printfMaterial(MaterialBean bean)
|
|
|
{
|
|
|
stringstream ss;
|
|
|
ss.str("");
|
|
|
ss<<"[MaterialBean pmpcCode="<<bean.pmpcCode;
|
|
|
ss<<",goodsCode="<<bean.goodsCode;
|
|
|
ss<<",goodsName="<<bean.goodsName;
|
|
|
ss<<",unitCode="<<bean.unitCode;
|
|
|
ss<<",spec="<<bean.spec;
|
|
|
ss<<",bpNo="<<bean.bpNo;
|
|
|
ss<<",state="<<bean.state;
|
|
|
ss<<",code="<<bean.code;
|
|
|
ss<<",teRe="<<bean.teRe;
|
|
|
ss<<",companyCode="<<bean.companyCode;
|
|
|
ss<<",userID="<<bean.userID<<" ]";
|
|
|
LINFO<<ss.str().c_str();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char* stringToCharP(std::string str){
|
|
|
// ³õʼ»¯ result
|
|
|
char* result = new char[str.length()+1];
|
|
|
// ¸³Öµ result
|
|
|
strcpy_s(result,str.length()+1,str.c_str());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
string GBKToUTF8(const std::string& strGBK)
|
|
|
{
|
|
|
string strOutUTF8 = "";
|
|
|
WCHAR * str1;
|
|
|
int n = MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, NULL, 0);
|
|
|
str1 = new WCHAR[n];
|
|
|
MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, str1, n);
|
|
|
n = WideCharToMultiByte(CP_UTF8, 0, str1, -1, NULL, 0, NULL, NULL);
|
|
|
char * str2 = new char[n];
|
|
|
WideCharToMultiByte(CP_UTF8, 0, str1, -1, str2, n, NULL, NULL);
|
|
|
strOutUTF8 = str2;
|
|
|
delete[]str1;
|
|
|
str1 = NULL;
|
|
|
delete[]str2;
|
|
|
str2 = NULL;
|
|
|
return strOutUTF8;
|
|
|
}
|
|
|
string proProcessCreate(tag_t rev,string &process_name)
|
|
|
{
|
|
|
int ifail = 0,att_type = EPM_target_attachment;
|
|
|
//rev_tag,
|
|
|
tag_t process_template, process = NULLTAG, *t;
|
|
|
//printf("Á÷³ÌÃû³Æ:%s\r\n",process_name.c_str());
|
|
|
//printf("GBKת»¯Á÷³ÌÃû³Æ:%s\r\n",GBKToUTF8(process_name).c_str());
|
|
|
SAFECALL(EPM_find_process_template(GBKToUTF8(process_name).c_str(), &process_template));
|
|
|
SAFECALL(ifail = EPM_create_process(GBKToUTF8(process_name).c_str(), "", process_template, 1, &rev,
|
|
|
&att_type, &process));
|
|
|
//SAFECALL(EPM_find_process_template(process_name.c_str(), &process_template));
|
|
|
///SAFECALL(ifail = EPM_create_process(process_name.c_str(), "", process_template, 1, &rev_tag,
|
|
|
|
|
|
tag_t user;
|
|
|
SAFECALL(SA_find_user2("dcproxy", &user));
|
|
|
if (ifail != 0) {
|
|
|
const char **err;
|
|
|
int n_ifails;
|
|
|
const int *e, *e2;
|
|
|
stringstream err_ss;
|
|
|
EMH_ask_errors(&n_ifails, &e, &e2, &err);
|
|
|
int n_end = n_ifails > 3 ? n_ifails - 3 : 0;
|
|
|
for (auto i = n_ifails - 1; i >= n_end; i--) {
|
|
|
err_ss << err[i];
|
|
|
}
|
|
|
return err_ss.str();
|
|
|
}
|
|
|
}
|
|
|
//ÎïÁϸüР¸üÐÂÎïÁÏ״̬
|
|
|
void updatePart(tag_t rev,MaterialBean bean,bool flag)
|
|
|
{
|
|
|
//LINFO<<"¸üÐÂ";
|
|
|
//printfMaterial(bean);
|
|
|
tag_t item;
|
|
|
ITEM_ask_item_of_rev(rev,&item);
|
|
|
char * item_id,*item_id2;
|
|
|
AOM_ask_value_string(rev,"item_id",&item_id);
|
|
|
AOM_ask_value_string(item,"item_id",&item_id2);
|
|
|
//LINFO<<"°æ±¾item_id:"<<item_id<<";¶ÔÏóitem_id:"<<item_id2;
|
|
|
SAFECALL(AOM_lock(item));
|
|
|
SAFECALL(AOM_set_value_string(item,"object_name",bean.goodsName.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(item,"zt2_unit",bean.unitCode.c_str()));
|
|
|
if(flag)
|
|
|
{
|
|
|
LINFO<<"¸ü¸ÄID";
|
|
|
SAFECALL(ITEM_set_id(item,bean.goodsCode.c_str()));
|
|
|
}
|
|
|
SAFECALL(AOM_save(item));
|
|
|
//SAFECALL(AOM_refresh(item,TRUE));
|
|
|
SAFECALL(AOM_unlock(item));
|
|
|
|
|
|
SAFECALL(AOM_lock(rev));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_name",bean.goodsName.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_MaterialNo",bean.goodsCode.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_desc",bean.spec.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_TechRequirements",bean.teRe.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_State",bean.state.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_ClassificationCode",bean.pmpcCode.c_str()));
|
|
|
SAFECALL(AOM_save(rev));
|
|
|
SAFECALL(AOM_unlock(rev));
|
|
|
}
|
|
|
|
|
|
//ÎïÁϸüР²»¸üÐÂ״̬
|
|
|
void updatePart2(tag_t rev,MaterialBean bean,bool flag)
|
|
|
{
|
|
|
//LINFO<<"¸üÐÂ";
|
|
|
//printfMaterial(bean);
|
|
|
tag_t item;
|
|
|
ITEM_ask_item_of_rev(rev,&item);
|
|
|
char * item_id,*item_id2;
|
|
|
AOM_ask_value_string(rev,"item_id",&item_id);
|
|
|
AOM_ask_value_string(item,"item_id",&item_id2);
|
|
|
//LINFO<<"°æ±¾item_id:"<<item_id<<";¶ÔÏóitem_id:"<<item_id2;
|
|
|
SAFECALL(AOM_lock(item));
|
|
|
SAFECALL(AOM_set_value_string(item,"object_name",bean.goodsName.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(item,"zt2_unit",bean.unitCode.c_str()));
|
|
|
if(flag)
|
|
|
{
|
|
|
LINFO<<"¸ü¸ÄID";
|
|
|
SAFECALL(ITEM_set_id(item,bean.goodsCode.c_str()));
|
|
|
}
|
|
|
SAFECALL(AOM_save(item));
|
|
|
//SAFECALL(AOM_refresh(item,TRUE));
|
|
|
SAFECALL(AOM_unlock(item));
|
|
|
|
|
|
SAFECALL(AOM_lock(rev));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_name",bean.goodsName.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_MaterialNo",bean.goodsCode.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_desc",bean.spec.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_TechRequirements",bean.teRe.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_State",bean.state.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_ClassificationCode",bean.pmpcCode.c_str()));
|
|
|
SAFECALL(AOM_save(rev));
|
|
|
SAFECALL(AOM_unlock(rev));
|
|
|
}
|
|
|
|
|
|
//ÎïÁÏ´´½¨
|
|
|
tag_t createPart(MaterialBean bean)
|
|
|
{
|
|
|
tag_t item,rev;
|
|
|
BusinessObject* item_i=nullptr;
|
|
|
CreateInput* itemCreateInput =static_cast<CreateInput*>(BusinessObjectRegistry::instance().createInputObject(
|
|
|
"Part", OPERATIONINPUT_CREATE));
|
|
|
SAFECALL(itemCreateInput->setString("object_name", bean.goodsName, false));
|
|
|
SAFECALL(itemCreateInput->setString("item_id",bean.goodsCode,false));
|
|
|
|
|
|
item_i =BusinessObjectRegistry::instance().createBusinessObject(itemCreateInput);
|
|
|
tag_t uom;
|
|
|
UOM_find_by_name("ZT2_zhongliang", &uom);
|
|
|
if (uom) {
|
|
|
item_i->setTag("uom_tag", uom, false);
|
|
|
}
|
|
|
SAFECALL(AOM_save_with_extensions(item_i->getTag()));
|
|
|
item = item_i->getTag();
|
|
|
SAFECALL(ITEM_ask_latest_rev(item,&rev));
|
|
|
ITEM_ask_item_of_rev(rev,&item);
|
|
|
SAFECALL(AOM_lock(item));
|
|
|
SAFECALL(AOM_set_value_string(item,"zt2_unit",bean.unitCode.c_str()));
|
|
|
SAFECALL(AOM_save(item));
|
|
|
SAFECALL(AOM_unlock(item));
|
|
|
SAFECALL(AOM_refresh(item,TRUE));
|
|
|
SAFECALL(AOM_lock(rev));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_name",bean.goodsName.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_MaterialNo",bean.goodsCode.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_desc",bean.spec.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_TechRequirements",bean.teRe.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_State",bean.state.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_ClassificationCode",bean.pmpcCode.c_str()));
|
|
|
SAFECALL(AOM_save(rev));
|
|
|
SAFECALL(AOM_unlock(rev));
|
|
|
SAFECALL(AOM_refresh(rev,TRUE));
|
|
|
return rev;
|
|
|
}
|
|
|
|
|
|
//ÎïÁÏ´´½¨
|
|
|
tag_t createPart(string &id)
|
|
|
{
|
|
|
tag_t item,rev;
|
|
|
BusinessObject* item_i=nullptr;
|
|
|
CreateInput* itemCreateInput =static_cast<CreateInput*>(BusinessObjectRegistry::instance().createInputObject(
|
|
|
"Part", OPERATIONINPUT_CREATE));
|
|
|
SAFECALL(itemCreateInput->setString("object_name", id, false));
|
|
|
SAFECALL(itemCreateInput->setString("item_id",id,false));
|
|
|
|
|
|
item_i =BusinessObjectRegistry::instance().createBusinessObject(itemCreateInput);
|
|
|
tag_t uom;
|
|
|
UOM_find_by_name("ZT2_zhongliang", &uom);
|
|
|
if (uom) {
|
|
|
item_i->setTag("uom_tag", uom, false);
|
|
|
}
|
|
|
SAFECALL(AOM_save_with_extensions(item_i->getTag()));
|
|
|
item = item_i->getTag();
|
|
|
SAFECALL(ITEM_ask_latest_rev(item,&rev));
|
|
|
ITEM_ask_item_of_rev(rev,&item);
|
|
|
SAFECALL(AOM_lock(item));
|
|
|
//SAFECALL(AOM_set_value_string(item,"zt2_unit",bean.unitCode.c_str()));
|
|
|
SAFECALL(AOM_save(item));
|
|
|
SAFECALL(AOM_unlock(item));
|
|
|
SAFECALL(AOM_refresh(item,TRUE));
|
|
|
SAFECALL(AOM_lock(rev));
|
|
|
SAFECALL(AOM_set_value_string(rev,"object_name",id.c_str()));
|
|
|
SAFECALL(AOM_set_value_string(rev,"zt2_MaterialNo",id.c_str()));
|
|
|
//SAFECALL(AOM_set_value_string(rev,"object_desc",bean.spec.c_str()));
|
|
|
//SAFECALL(AOM_set_value_string(rev,"zt2_TechRequirements",bean.teRe.c_str()));
|
|
|
//SAFECALL(AOM_set_value_string(rev,"zt2_State",bean.state.c_str()));
|
|
|
//SAFECALL(AOM_set_value_string(rev,"zt2_ClassificationCode",bean.pmpcCode.c_str()));
|
|
|
SAFECALL(AOM_save(rev));
|
|
|
SAFECALL(AOM_unlock(rev));
|
|
|
SAFECALL(AOM_refresh(rev,TRUE));
|
|
|
return rev;
|
|
|
}
|
|
|
|
|
|
void updateMaterial()
|
|
|
{
|
|
|
LINFO<<"ÎïÁϸüпªÊ¼-------------"<<getTime();
|
|
|
/*
|
|
|
MaterialBean bean;
|
|
|
bean.goodsCode="20200813";
|
|
|
bean.goodsName="Ð첨ÌβâÊÔ";
|
|
|
bean.pmpcCode="1000020200813";
|
|
|
bean.spec="2X4X100 8ZDK.358.001 S";
|
|
|
bean.state="D1";
|
|
|
bean.unitCode="ST";
|
|
|
printf("¿ªÊ¼´´½¨¶ÔÏó\r\n");
|
|
|
POM_AM__set_application_bypass(true);
|
|
|
tag_t rev =createPart(bean);
|
|
|
printf("´´½¨¶ÔÏó½áÊø\r\n");
|
|
|
string process_name = "TCM Release Process";
|
|
|
int rel_cnt;
|
|
|
tag_t *rels;
|
|
|
SAFECALL(AOM_ask_value_tags(rev, "release_status_list", &rel_cnt, &rels)); //δ·¢²¼,ÏÂÒ»¸ö
|
|
|
if (rel_cnt < 1)
|
|
|
{
|
|
|
printf("δ·¢²¼\r\n");
|
|
|
proProcessCreate(rev,process_name);
|
|
|
printf("Á÷³Ì·¢²¼½áÊø");
|
|
|
}else
|
|
|
{
|
|
|
printf("ÒÑ·¢²¼\r\n");
|
|
|
}
|
|
|
*/
|
|
|
|
|
|
db db;
|
|
|
SAConnection conn;
|
|
|
SACommand command;
|
|
|
int pref_cnt;
|
|
|
char **pref_vals;
|
|
|
PREF_ask_char_values("database_tc", &pref_cnt, &pref_vals);
|
|
|
try{
|
|
|
stringstream ss;
|
|
|
ss << pref_vals[0] << ':' << pref_vals[1] << '/' << pref_vals[2];
|
|
|
conn.Connect(ss.str().c_str(), pref_vals[3], pref_vals[4],
|
|
|
SA_Oracle_Client);
|
|
|
|
|
|
//ss << "10.128.155.88" << ':' << "1521" << '/' << "testdb";
|
|
|
//conn.Connect(ss.str().c_str(), "infodba", "infodba",
|
|
|
// SA_Oracle_Client);
|
|
|
command.setConnection(&conn);
|
|
|
db.command = &command;
|
|
|
vector<MaterialBean> materials = db.getMaterials();
|
|
|
POM_AM__set_application_bypass(true);
|
|
|
int size = materials.size();
|
|
|
string process_name = "TCM Release Process";
|
|
|
for(auto i=0;i<size;i++)
|
|
|
{
|
|
|
MaterialBean bean = materials[i];
|
|
|
tag_t item = NULLTAG,rev = NULLTAG;
|
|
|
char *zt2_MaterialNo;
|
|
|
string p_status="1";
|
|
|
string p_rec_date=getTime();
|
|
|
printfMaterial(bean);
|
|
|
if(bean.goodsCode.empty())
|
|
|
{
|
|
|
LINFO<<"Òì³£ÎïÁÏ----->";
|
|
|
p_status="-1";
|
|
|
//printfMaterial(bean);
|
|
|
continue;
|
|
|
}
|
|
|
ITEM_find_item(bean.goodsCode.c_str(),&item);
|
|
|
if(item)
|
|
|
{
|
|
|
ITEM_ask_latest_rev(item,&rev);
|
|
|
}
|
|
|
|
|
|
if(bean.code == 0)
|
|
|
{
|
|
|
|
|
|
bean.code = db.getCodeByGoodsCode(bean.goodsCode);
|
|
|
if(bean.code==0)
|
|
|
{
|
|
|
bean.code = db.getCode();
|
|
|
}
|
|
|
LINFO<<"CODEΪ0-->ÐÂCode:"+bean.code;
|
|
|
if(item)
|
|
|
{
|
|
|
char *uid ;
|
|
|
ITK__convert_tag_to_uid(rev,&uid);
|
|
|
bean.puid = uid;
|
|
|
LINFO<<"¸üÐÂÎïÁÏ(ÎÞÐè¸ü¸ÄID)¿ªÊ¼-->"<<bean.goodsCode.c_str();
|
|
|
updatePart(rev,bean,false);
|
|
|
LINFO<<"ÎïÁϸüнáÊø-->";
|
|
|
}else
|
|
|
{
|
|
|
LINFO<<"--н¨¶ÔÏó¿ªÊ¼:"<<bean.goodsCode.c_str();
|
|
|
rev = createPart(bean);
|
|
|
char *uid ;
|
|
|
ITK__convert_tag_to_uid(rev,&uid);
|
|
|
bean.puid = uid;
|
|
|
LINFO<<"--н¨¶ÔÏó½áÊø:"<<bean.goodsCode.c_str();
|
|
|
}
|
|
|
}else
|
|
|
{
|
|
|
LINFO<<"CODE²»Îª0-->"<<bean.code;
|
|
|
vector<string> vecs = db.queryByCode(bean.code);
|
|
|
bool flag = false;
|
|
|
if(vecs.size()==2)
|
|
|
{
|
|
|
//printf("userID:%s,puid:%s;\r\n",bean.userID.c_str(),bean.puid.c_str());
|
|
|
bean.puid = vecs[0];
|
|
|
bean.userID = vecs[1];
|
|
|
//printf("userID:%s,puid:%s;\r\n",bean.userID.c_str(),bean.puid.c_str());
|
|
|
|
|
|
flag = true;
|
|
|
}
|
|
|
LINFO<<"Code["<<bean.code<<"]¼Ç¼ÔUID-->["<<bean.puid.c_str()<<"];Óû§:["<<bean.userID.c_str()<<"]";
|
|
|
if(bean.puid.empty())
|
|
|
{
|
|
|
LINFO<<"puidΪ¿Õ";
|
|
|
if(item)
|
|
|
{
|
|
|
//ITEM_ask_latest_rev(item,&rev);
|
|
|
char *uid ;
|
|
|
ITK__convert_tag_to_uid(rev,&uid);
|
|
|
bean.puid = uid;
|
|
|
LINFO<<"¸üÐÂÎïÁÏ(ÎÞÐè¸ü¸ÄID)¿ªÊ¼-->"<<bean.goodsCode.c_str();
|
|
|
updatePart(rev,bean,false);
|
|
|
LINFO<<"ÎïÁϸüнáÊø-->";
|
|
|
}else
|
|
|
{
|
|
|
LINFO<<"¼Ç¼Ϊ["<<bean.code<<"]µÄÊý¾Ýδ¼Ç¼¶ÔÏó£¬------->н¨";
|
|
|
rev = createPart(bean);
|
|
|
char *uid ;
|
|
|
ITK__convert_tag_to_uid(rev,&uid);
|
|
|
bean.puid = uid;
|
|
|
LINFO<<"н¨½áÊø";
|
|
|
}
|
|
|
}else
|
|
|
{
|
|
|
LINFO<<"PUID²»Îª¿Õ";
|
|
|
tag_t uid_rev = NULLTAG;
|
|
|
ITK__convert_uid_to_tag(bean.puid.c_str(),&uid_rev);
|
|
|
//char *item_id;
|
|
|
if(uid_rev && item)
|
|
|
{
|
|
|
LINFO<<"ÎïÁϱàÂë¶ÔÏó´æÔÚ£¬ÔUID¶ÔÏó´æÔÚ";
|
|
|
SAFECALL(AOM_ask_value_string(uid_rev,"zt2_MaterialNo",&zt2_MaterialNo));
|
|
|
char *item_id;
|
|
|
SAFECALL(AOM_ask_value_string(uid_rev,"item_id",&item_id));
|
|
|
string MaterialNo = zt2_MaterialNo;
|
|
|
if(strcmp(item_id,bean.goodsCode.c_str())==0)
|
|
|
{
|
|
|
LINFO<<"ÎïÁϸüÐÂ-->"<<bean.goodsCode.c_str();
|
|
|
rev = uid_rev;
|
|
|
updatePart(uid_rev,bean,false);
|
|
|
LINFO<<"ÎïÁϸüнáÊø";
|
|
|
}else
|
|
|
{
|
|
|
LINFO<<"Òì³£;UID¶ÔÏó[item_id="<<item_id<<",uid="<<bean.puid.c_str()<<"];ÎïÁ϶ÔÏó[ID="<<bean.goodsCode.c_str()<<"]";
|
|
|
p_status = "-1";
|
|
|
if(!MaterialNo.empty() && strcmp(zt2_MaterialNo,bean.goodsCode.c_str())!=0)
|
|
|
{
|
|
|
LINFO<<"Êý¾ÝÒì³£----Code="<<bean.code<<";ÎïÁϱàÂë="<<bean.goodsCode.c_str();
|
|
|
p_status="-1";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}else
|
|
|
{
|
|
|
//1.ÎïÁϱàÂë¶ÔÏó´æÔÚ£¬ÔUID¶ÔÏó²»´æÔÚ,¸üÐÂ
|
|
|
if(item)
|
|
|
{
|
|
|
LINFO<<"ÎïÁϱàÂë¶ÔÏó´æÔÚ£¬ÔUID¶ÔÏó²»´æÔÚ,¸üÐÂ";
|
|
|
//ITEM_ask_latest_rev(item,&rev);
|
|
|
char *uid ;
|
|
|
ITK__convert_tag_to_uid(rev,&uid);
|
|
|
bean.puid = uid;
|
|
|
LINFO<<"¸üÐÂÎïÁÏ(ÎÞÐè¸ü¸ÄID)¿ªÊ¼-->"<<bean.goodsCode.c_str();
|
|
|
updatePart(rev,bean,false);
|
|
|
LINFO<<"ÎïÁϸüнáÊø-->";
|
|
|
}
|
|
|
//2.ÔUID¶ÔÏó´æÔÚ£¬ÎïÁϱàÂë¶ÔÏó²»´æÔÚ
|
|
|
else if(uid_rev)
|
|
|
{
|
|
|
LINFO<<"ÔUID¶ÔÏó´æÔÚ£¬ÎïÁϱàÂë¶ÔÏó²»´æÔÚ";
|
|
|
char *item_id;
|
|
|
SAFECALL(AOM_ask_value_string(uid_rev,"item_id",&item_id));
|
|
|
LINFO<<"ÔID["<<item_id<<"],ÐÂID["<<bean.goodsCode.c_str()<<"]";
|
|
|
rev = uid_rev;
|
|
|
//ÎÞÐè¸ü¸ÄID¸üÐÂ
|
|
|
if(strcmp(item_id,bean.goodsCode.c_str())==0)
|
|
|
{
|
|
|
LINFO<<"¸üÐÂÎïÁÏ(ÎÞÐè¸ü¸ÄID)¿ªÊ¼-->"<<bean.goodsCode.c_str();
|
|
|
updatePart(uid_rev,bean,false);
|
|
|
LINFO<<"ÎïÁϸüнáÊø-->";
|
|
|
}else
|
|
|
{
|
|
|
LINFO<<"¸üÐÂÎïÁÏ(¸ü¸ÄID)¿ªÊ¼-->"<<bean.goodsCode.c_str();
|
|
|
updatePart(uid_rev,bean,true);
|
|
|
LINFO<<"ÎïÁϸüнáÊø-->";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if(flag)
|
|
|
{
|
|
|
db.updateMaterial2(p_status,bean.code,bean.goodsCode);
|
|
|
}
|
|
|
}
|
|
|
if(rev)
|
|
|
{
|
|
|
int rel_cnt;
|
|
|
tag_t *rels;
|
|
|
SAFECALL(AOM_ask_value_tags(rev, "release_status_list", &rel_cnt, &rels)); //δ·¢²¼,ÏÂÒ»¸ö
|
|
|
if (rel_cnt < 1)
|
|
|
{
|
|
|
LINFO<<"°æ±¾·¢²¼------->";
|
|
|
proProcessCreate(rev,process_name);
|
|
|
}
|
|
|
}
|
|
|
db.updateMaterial1(p_status,p_rec_date,bean.puid,bean.userID,bean.code,bean.goodsCode);
|
|
|
}
|
|
|
conn.Disconnect();
|
|
|
|
|
|
}catch(SAException e)
|
|
|
{
|
|
|
printf("Òì³£\n");
|
|
|
e.ErrMessage();
|
|
|
LINFO<<e.ErrMessage().GetMultiByteChars();
|
|
|
printf(e.ErrMessage());
|
|
|
}
|
|
|
|
|
|
LINFO<<"ÎïÁϸüнáÊø-------------";
|
|
|
} |