Skip to content

Commit

Permalink
Merge pull request #1260 from hanshuaikang/feature/develop_by_han
Browse files Browse the repository at this point in the history
fix: 修复快速审批单据字段顺序与实际不一致的问题
  • Loading branch information
hanshuaikang authored Jan 17, 2024
2 parents 6ceab41 + 0fae40f commit adf9f3e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions itsm/component/bkchat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ def build_bkchat_summary(ticket):

# 添加「提单信息」
content = "{}\n **--- 单据基本信息 ---**".format(content)
state_fields = ticket.get_state_fields(ticket.first_state_id, need_serialize=False)
state_fields = ticket.get_state_fields(
ticket.first_state_id, need_serialize=False
).exclude(type__in=["TABLE", "CUSTOMTABLE", "FILE"])
field_order = ticket.state(ticket.first_state_id)["fields"]
fields_map = {f.workflow_field_id: f for f in state_fields}
# 隐藏字段过滤
for f in state_fields.exclude(type__in=["TABLE", "CUSTOMTABLE", "FILE"]):
for index in field_order:
f = fields_map.get(index, None)
if f is None:
continue
if f.show_type == SHOW_BY_CONDITION:
key_value = {
"params_%s"
Expand Down

0 comments on commit adf9f3e

Please sign in to comment.