|
@@ -149,20 +149,20 @@ def business_service(session_id, uid, code, tools, asr):
|
|
|
conclusions = [f"预计{time}恢复供水" if time is not None else "暂未确定恢复时间" for time in timeEnd]
|
|
|
nums = len(neighbourhoodName)
|
|
|
mess +=";".join([",".join(i) for i in zip(neighbourhoodName, reason, timeBegin, conclusions)])
|
|
|
- mess +=",解决轻按1,未解决请按2"
|
|
|
+ mess +=",是否已解决您的问题?"
|
|
|
elif tools in ["fee_info", "fee_user_info"]:
|
|
|
mess = "您账户截止"
|
|
|
statisticsTime = [content.get("statisticsTime", '') for content in contents]
|
|
|
waterFees = [round(float(content.get("waterFees", 0)), 2) for content in contents]
|
|
|
- meterAmount = [round(float(content.get("meterAmount", 0)),2) for content in contents]
|
|
|
- mess = mess + statisticsTime[0] + "您的抄表表数为"+str(meterAmount[0]) +"欠费金额为" + str(waterFees[0])+ "元。如需详细查询缴费和水量情况可以登陆佳木斯供水公众号,如需人工查询请拨打8247777,解决轻按1, 未解决请按2."
|
|
|
+ meterAmount = [round(float(content.get("meterAmount", 0)), 2) for content in contents]
|
|
|
+ mess = mess + statisticsTime[0] + "您的抄表表数为"+str(meterAmount[0]) +"欠费金额为" + str(waterFees[0])+ "元。如需详细查询缴费和水量情况可以登陆佳木斯供水公众号,如需人工查询请拨打824/--/777/--/6,还有什么可以帮你?."
|
|
|
elif tools in ["user_info", "user_phone_info"]:
|
|
|
neighbour, cardNo = [content.get("neighbourhoodName") for content in contents], [content.get("userNo") for content in contents]
|
|
|
nums = len(neighbour)
|
|
|
mess = f"根据您的手机号查询到{nums}个小区," + ";".join(map(lambda x: ",".join(x), zip(neighbour, ["户号是"]* nums, cardNo)))+ "。解决轻按1, 未解决请安2."
|
|
|
elif tools in ["meter_owner_phone", "meter_owner_neighbour"]:
|
|
|
loc_phone = [[content['neighbourhoodName'], content['meterReaderPhone']] for content in contents]
|
|
|
- mess = f"您查询的小区{loc_phone[0][0]},抄表员电话是{loc_phone[0][1]},抄表员电话是{loc_phone[0][1]}, 重听请说再说一次,解决轻按“1”, 未解决请按“2”."
|
|
|
+ mess = f"您查询的小区{loc_phone[0][0]},抄表员电话是{loc_phone[0][1]};抄表员电话是{loc_phone[0][1]}, 重听请说再说一次,是否已解决您的问题?"
|
|
|
else:
|
|
|
mess = ''
|
|
|
return mess
|
|
@@ -176,8 +176,34 @@ def business_service(session_id, uid, code, tools, asr):
|
|
|
if tools in ["water_loc_info", "fee_user_info", "user_phone_info", "meter_owner_neighbour"] and len(asr)==0:
|
|
|
return [{"title": "NO", "isFaq": False, "faqContent": '', "asr": asr, "businessContent": ''}]
|
|
|
# parse water_loc_info
|
|
|
- if tools in ["water_loc_info", "meter_owner_neighbour"]:
|
|
|
+ if tools in ["water_loc_info", "meter_owner_neighbour", "water_info", "meter_owner_phone"]:
|
|
|
asr = norm_community(asr)
|
|
|
+ if tools in ["water_info", "meter_owner_phone"]:
|
|
|
+ newtools = "water_loc_info" if tools == "water_info" else "meter_owner_neighbour"
|
|
|
+ param = json.dumps(dict(nodeId=code,
|
|
|
+ userId=uid,
|
|
|
+ sessionId=session_id,
|
|
|
+ asrText=asr,
|
|
|
+ method=newtools
|
|
|
+ ), ensure_ascii=False)
|
|
|
+ try:
|
|
|
+ # 192.168.40.21
|
|
|
+ res = requests.post(f"http://{SERVE_HOST}:8001/bigModel/queryBusinessInfo",
|
|
|
+ param.encode("UTF-8"),
|
|
|
+ headers={'Content-Type': 'application/json;charset=utf-8'},
|
|
|
+ timeout=30)
|
|
|
+ resp = json.loads(res.text)
|
|
|
+ logger.info(f"bussiness:{resp}, tools:{tools}, session:{session_id}")
|
|
|
+ if resp['code'] == "0":
|
|
|
+ content = resp['data'].get("contents")
|
|
|
+ title = "NO" if content is None or len(content) == 0 else "YES"
|
|
|
+ businessContent = getContent(content, tools) if title == "YES" else ''
|
|
|
+ opt = [
|
|
|
+ {"title": title, "isFaq": False, "faqContent": '', "asr": asr, "businessContent": businessContent}]
|
|
|
+ logger.info(f"code:{code},uid:{uid}, tools:{tools},asr:{asr}, opt:{opt}")
|
|
|
+ return opt
|
|
|
+ except Exception as e:
|
|
|
+ logger.info(f"bussion service服务异常:session:{session_id}, tools:{tools},uid:{uid}:{e}")
|
|
|
param = json.dumps(dict(nodeId=code,
|
|
|
userId=uid,
|
|
|
sessionId=session_id,
|