|
@@ -135,29 +135,67 @@ void module_meta_date_changed::clear_card(std::shared_ptr<card_location_base> ca
|
|
|
|
|
|
void module_meta_date_changed::deal_call_edit_vehicle(int64_t id64, EDIT_TYPE_ID edit_type_id)
|
|
|
{
|
|
|
+ //车信息修改 id64=车ID vehicle_id
|
|
|
if(ET_INSERT == edit_type_id || ET_UPDATE == edit_type_id)
|
|
|
{
|
|
|
- card_list::instance()->init_vehicle(id64);
|
|
|
+ char sql[1024] = {'\0'};
|
|
|
+ sprintf(sql,"select card_id from dat_vehicle_extend where vehicle_id=%d;", (int)id64);
|
|
|
+ std::string Error;
|
|
|
+ YADB::CDBResultSet DBRes;
|
|
|
+ sDBConnPool.Query(sql,DBRes,Error);
|
|
|
+ int64_t nCount = DBRes.GetRecordCount( Error );
|
|
|
+ if (nCount > 0)
|
|
|
+ {
|
|
|
+ int64_t card_id = 0;
|
|
|
+ while ( DBRes.GetNextRecod(Error) )
|
|
|
+ {
|
|
|
+ std::string szCard_id;
|
|
|
+ DBRes.GetField( "card_id",szCard_id, Error );
|
|
|
+ card_id = atoll(szCard_id.c_str());
|
|
|
+ }
|
|
|
+ card_list::instance()->init_vehicle(card_id);
|
|
|
+ }
|
|
|
}
|
|
|
else if(ET_DELETE == edit_type_id)
|
|
|
{
|
|
|
- auto str = tool_other::to13str(id64);
|
|
|
+ auto c = card_list::instance()->get_card_by_cid(id64);
|
|
|
+ remove_card(c);
|
|
|
|
|
|
- remove_card(tool_other::id64_to_id(str), tool_other::id64_to_type(str));
|
|
|
+ //auto str = tool_other::to13str(id64);
|
|
|
+ //remove_card(tool_other::id64_to_id(str), tool_other::id64_to_type(str));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void module_meta_date_changed::deal_call_edit_staff(int64_t id64, EDIT_TYPE_ID edit_type_id)
|
|
|
{
|
|
|
+ //人员信息更改 id64=人员ID staff_id
|
|
|
if(ET_INSERT == edit_type_id || ET_UPDATE == edit_type_id)
|
|
|
{
|
|
|
- card_list::instance()->init_staffer(id64);
|
|
|
+ char sql[1024] = {'\0'};
|
|
|
+ sprintf(sql,"select card_id from dat_staff_extend where staff_id=%d;", (int)id64);
|
|
|
+ std::string Error;
|
|
|
+ YADB::CDBResultSet DBRes;
|
|
|
+ sDBConnPool.Query(sql,DBRes,Error);
|
|
|
+ int64_t nCount = DBRes.GetRecordCount( Error );
|
|
|
+ if (nCount > 0)
|
|
|
+ {
|
|
|
+ int64_t card_id = 0;
|
|
|
+ while ( DBRes.GetNextRecod(Error) )
|
|
|
+ {
|
|
|
+ std::string szCard_id;
|
|
|
+ DBRes.GetField( "card_id",szCard_id, Error );
|
|
|
+ card_id = atoll(szCard_id.c_str());
|
|
|
+ }
|
|
|
+ card_list::instance()->init_staffer(card_id);
|
|
|
+ }
|
|
|
}
|
|
|
else if(ET_DELETE == edit_type_id)
|
|
|
{
|
|
|
- auto str = tool_other::to13str(id64);
|
|
|
+ auto c = card_list::instance()->get_card_by_cid(id64);
|
|
|
+ remove_card(c);
|
|
|
+ //auto str = tool_other::to13str(id64);
|
|
|
|
|
|
- remove_card(tool_other::id64_to_id(str), tool_other::id64_to_type(str));
|
|
|
+ //remove_card(tool_other::id64_to_id(str), tool_other::id64_to_type(str));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -304,16 +342,22 @@ void module_meta_date_changed::init_setting()
|
|
|
//pRes = getMysqlRes("select setting_id, name, type, value from dat_setting;");
|
|
|
}
|
|
|
|
|
|
-void module_meta_date_changed::remove_card(uint32_t id, int32_t type)
|
|
|
-{
|
|
|
+void module_meta_date_changed::remove_card(uint32_t id, int32_t type) {
|
|
|
uint64_t card_id = tool_other::type_id_to_u64(type, id);
|
|
|
auto card_ptr = card_list::instance()->get(card_id);
|
|
|
- if(!card_ptr)
|
|
|
- {
|
|
|
+ if (!card_ptr) {
|
|
|
log_error("基础数据, 在全局列表中删除卡,全局列表中已经不存在此卡, id=%d, type=%d", id, type);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ remove_card(card_ptr);
|
|
|
+}
|
|
|
+void module_meta_date_changed::remove_card(std::shared_ptr<card_location_base> card_ptr)
|
|
|
+{
|
|
|
+ if (!card_ptr)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ log_info("基础数据, 在全局列表中删除卡成功, id=%d, type=%d",card_ptr->m_type, card_ptr->m_id);
|
|
|
// auto area_hover_ptr = card_ptr->get_area_hover();
|
|
|
// if(area_hover_ptr && 0!=area_hover_ptr->id() && 0!=area_hover_ptr->mapid())
|
|
|
// {
|
|
@@ -330,11 +374,10 @@ void module_meta_date_changed::remove_card(uint32_t id, int32_t type)
|
|
|
|
|
|
// module_meta_date_changed::clear_card(card_ptr);
|
|
|
// }
|
|
|
-
|
|
|
module_meta_date_changed::clear_card(card_ptr);
|
|
|
// 避免状态重置
|
|
|
+ uint64_t card_id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id);
|
|
|
card_list::instance()->remove(card_id);
|
|
|
- log_info("基础数据, 在全局列表中删除卡成功, id=%d, type=%d", id, type);
|
|
|
}
|
|
|
|
|
|
bool module_meta_date_changed::try_get_edit_type_id(const std::string& op_type, EDIT_TYPE_ID& out_edit_type_id)
|