From 98ab630bead038195e941b0cca647d2865508c3b Mon Sep 17 00:00:00 2001 From: hanshuaikang <1758504262@qq.com> Date: Mon, 28 Aug 2023 15:19:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feature:=20=E7=A4=BE=E5=8C=BA=E7=89=88?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AE=A1=E6=89=B9=E5=8A=A9=E6=89=8B=E7=9A=84?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform_config/open/bkchat/utils.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/platform_config/open/bkchat/utils.py b/platform_config/open/bkchat/utils.py index 8b7aa34c..12198550 100644 --- a/platform_config/open/bkchat/utils.py +++ b/platform_config/open/bkchat/utils.py @@ -184,10 +184,10 @@ def send_fast_approval_message(title, content, receivers, ticket, state_id): ) ) # 验证是否请求成功 - if result.get("code") != 0: + if not result.get("result"): logger.info( "[fast_approval({})]send fast approval message failed:{}".format( - ticket_sn, result.message + ticket_sn, result.get("message") ) ) except ComponentCallError as error: @@ -210,7 +210,7 @@ def proceed_fast_approval(request): """ # 1.解密request变携带的加密信息 - result = json.loads(request.body) + result = request.data # 2.对解密后的字段进行获取 ticket_id = int(result.get("context").get("ticket_id")) @@ -227,8 +227,11 @@ def proceed_fast_approval(request): return JsonResponse( { "result": False, - "data": {"approver": ticket.get_approver(state_id)}, - "code": 0, + "data": { + "approve_result": ticket.get_state_approve_result(state_id), + "approver": ticket.get_approver(state_id), + }, + "code": -1, "message": "{}\n{}".format(title, content), } ) @@ -280,7 +283,7 @@ def proceed_fast_approval(request): { "result": False, "data": None, - "code": 0, + "code": -1, "message": "快速审批异常,请联系管理员", } ) From 5dba980510fe6337bc5df1c4708b7684136fde2b Mon Sep 17 00:00:00 2001 From: hanshuaikang <1758504262@qq.com> Date: Mon, 28 Aug 2023 15:37:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?minor:=20=E5=8D=95=E6=8D=AE=E6=94=AF?= =?UTF-8?q?=E6=8C=81tag=E5=AD=97=E6=AE=B5=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- itsm/ticket/views/ticket.py | 1 + 1 file changed, 1 insertion(+) diff --git a/itsm/ticket/views/ticket.py b/itsm/ticket/views/ticket.py index bee8bdae..d7452d63 100644 --- a/itsm/ticket/views/ticket.py +++ b/itsm/ticket/views/ticket.py @@ -242,6 +242,7 @@ class TicketModelViewSet(ModelViewSet): "service_id": ["exact", "in"], "create_at": ["lte", "gte"], "bk_biz_id": ["exact", "in"], + "tag": ["exact"], } ordering_fields = ("create_at",)