|
@@ -13,19 +13,6 @@
|
|
|
extern config_file config;
|
|
|
namespace db_card
|
|
|
{
|
|
|
- static std::string to13str(uint64_t data)
|
|
|
- {
|
|
|
- char ss[20]={0};
|
|
|
- sprintf(ss, "%013ld", data);
|
|
|
-
|
|
|
- return std::string(ss);
|
|
|
- }
|
|
|
-
|
|
|
- static uint64_t getId(uint32_t cardid,uint64_t type)
|
|
|
- {
|
|
|
- return type<<32|cardid;
|
|
|
- }
|
|
|
-
|
|
|
std::unordered_map<uint64_t,std::shared_ptr<card_location_base>> load_car(int64_t id64)
|
|
|
{
|
|
|
std::string sql = "SELECT ve.vehicle_id, ve.card_id, c.card_type_id, \
|
|
@@ -43,7 +30,7 @@ namespace db_card
|
|
|
|
|
|
std::unordered_map<uint64_t,std::shared_ptr<card_location_base>> map;
|
|
|
|
|
|
- std::string card_id_str = to13str(id64);
|
|
|
+ std::string card_id_str = tool_other::to13str(id64);
|
|
|
|
|
|
if(-1 == id64)
|
|
|
{
|
|
@@ -116,7 +103,7 @@ namespace db_card
|
|
|
|
|
|
auto clb = card_location_base::make_car(strategy,vsid,need_display,card_type_id,
|
|
|
dept_id,vehicle_category_id, vehicle_type_id,vehicle_level_id,vehicle_id);
|
|
|
- uint64_t cardid = getId(vsid,card_type_id);
|
|
|
+ uint64_t cardid = tool_other::type_id_to_u64(card_type_id,vsid);
|
|
|
log_info("cardId:%llu,id:%d dept_id:%d,need_display:%d-cardid:%s,categoryid:%d,vchile_id:%d,type:%d",
|
|
|
cardid,vsid,dept_id,need_display,card_id.c_str(),vehicle_category_id,vehicle_id,card_type_id);
|
|
|
map.insert({cardid,clb});
|
|
@@ -142,7 +129,7 @@ namespace db_card
|
|
|
WHERE s.duty_id = 0 AND c.state_id = 0";
|
|
|
|
|
|
std::unordered_map<uint64_t,std::shared_ptr<card_location_base>> map;
|
|
|
- std::string card_id_str = to13str(id64);
|
|
|
+ std::string card_id_str = tool_other::to13str(id64);
|
|
|
if(-1 == id64)
|
|
|
{
|
|
|
sql.append(";");
|
|
@@ -205,7 +192,7 @@ namespace db_card
|
|
|
|
|
|
std::shared_ptr<card_location_base> clb =
|
|
|
std::make_shared<person>(strategy,vsid,need_display,card_type_id,dept_id,occupation_level_id,staff_id,work_line,staffer_name,dept_name);
|
|
|
- uint64_t cardid = tool_other::type_id_to_u64(vsid,card_type_id);
|
|
|
+ uint64_t cardid = tool_other::type_id_to_u64(card_type_id,vsid);
|
|
|
log_info("cardId:%llu,id:%d dept_id:%d,need_display:%d,card:%s:work_line:%d,staff_id:%d,type:%d,staffer_name:%s,dept_name:%s",
|
|
|
cardid,vsid,dept_id,need_display,card_id.c_str(),work_line,staff_id,card_type_id,staffer_name.c_str(),dept_name.c_str());
|
|
|
map.insert({cardid,clb});
|