Commit 508875b3 authored by 段英荣's avatar 段英荣

modify

parent 3b750ff4
......@@ -7,6 +7,7 @@ import traceback
from libs.tools import tzlc
from libs.es import ESPerform
from libs.cache import redis_client
import json
import pypinyin
from pypinyin import lazy_pinyin
......@@ -27,8 +28,8 @@ class DoctorTransfer(object):
@classmethod
def get_doctor_data_name_mapping_results_to_redis(cls, instance):
try:
doctor_name = instance.name
if doctor_name.strip():
doctor_name = instance.name.strip()
if doctor_name:
multi_fields = {
'hospital.city_province_name': 1,
'hospital.name': 1,
......@@ -73,7 +74,7 @@ class DoctorTransfer(object):
redis_val_dict['d'] = doctor_results
logging.info("duan add,redis_key_prefix:%s,redis_val_dict:%s" % (str(redis_key_prefix),str(redis_val_dict)))
redis_client.hmset(redis_key_prefix, redis_val_dict)
redis_client.hset(redis_key_prefix,doctor_name, json.dumps(redis_val_dict))
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment