From 8a29f763a8b0cab4dd0ba46b7b80afcb7967dcc2 Mon Sep 17 00:00:00 2001 From: shihxuancheng Date: Tue, 12 Nov 2019 18:11:58 +0800 Subject: [PATCH] bug fix --- back_end/bot_app/fulfillment/system_pic.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/back_end/bot_app/fulfillment/system_pic.py b/back_end/bot_app/fulfillment/system_pic.py index c9c4435..fd8f9ef 100644 --- a/back_end/bot_app/fulfillment/system_pic.py +++ b/back_end/bot_app/fulfillment/system_pic.py @@ -58,11 +58,18 @@ def forward_issue(fulfillment): sys_code = params.get('sys_code') # get user name, div, dept information from sec system by employee_no - user_name = 'Richard Shih' + strsql = 'select user_name_e from sec1102 where user_code=:user_code and rownum <=1' + with util.get_db_conn() as conn: + res = conn.execute(strsql, user_code=employee_no) + res = res.fetchall() + if len(res) == 0: + user_name = '' + else: + for row in res: + user_name = row[0] strRes = '好的' + user_name + '已將您的問題 "' + issue + '" 轉達給 ' + sys_code + ' 負責人' return util.clear_response(fulfillment, strRes) - def init_app(app): pass \ No newline at end of file