diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py index c4144f0e6..fa77fa18b 100644 --- a/yuthon_notice/models/yuthon_notice.py +++ b/yuthon_notice/models/yuthon_notice.py @@ -211,7 +211,6 @@ class YuthonNotice(models.Model): continue url = f'https://phone.thtzjt.com/phone/Notice/{self.id}?employee_id={employee.id}' - # 发送消息(和上面保持完全一致) result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard( category='notice', touser=user_id.employee_id.wecom_userid, @@ -222,8 +221,9 @@ class YuthonNotice(models.Model): ) msg_id = None - if result_data and 'msgid' in result_data[-1]: - msg_id = result_data[-1]['msgid'] + if result_data: + res_dict = result_data[1] + msg_id = res_dict.get('msgid') user_wecom_mapping.append({ 'emp_id': employee.id,