123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- from service.base_service import BaseService
- class ConstantService(BaseService):
- """一些常量"""
- def __init__(self):
- self.ACCOUNT_TYPE_COMMON = 0
- self.ACCOUNT_TYPE_WORKFLOW_ADMIN = 1
- self.ACCOUNT_TYPE_SUPER_ADMIN = 2
- self.STATE_TYPE_START = 1
- self.STATE_TYPE_END = 2
- self.STATE_DISTRIBUTE_TYPE_ACTIVE = 1
- self.STATE_DISTRIBUTE_TYPE_DIRECT = 2
- self.STATE_DISTRIBUTE_TYPE_RANDOM = 3
- self.STATE_DISTRIBUTE_TYPE_ALL = 4
- self.TICKET_ACT_STATE_DRAFT = 0
- self.TICKET_ACT_STATE_ONGOING = 1
- self.TICKET_ACT_STATE_BACK = 2
- self.TICKET_ACT_STATE_RETREAT = 3
- self.TICKET_ACT_STATE_FINISH = 4
- self.TICKET_ACT_STATE_CLOSED = 5
- self.PARTICIPANT_TYPE_PERSONAL = 1
- self.PARTICIPANT_TYPE_MULTI = 2
- self.PARTICIPANT_TYPE_DEPT = 3
- self.PARTICIPANT_TYPE_ROLE = 4
- self.PARTICIPANT_TYPE_VARIABLE = 5
- self.PARTICIPANT_TYPE_ROBOT = 6
- self.PARTICIPANT_TYPE_FIELD = 7
- self.PARTICIPANT_TYPE_PARENT_FIELD = 8
- self.PARTICIPANT_TYPE_HOOK = 10
- self.PARTICIPANT_TYPE_FROM_EXTERNAL = 11
- self.TRANSITION_TYPE_COMMON = 1
- self.TRANSITION_TYPE_TIMER = 2
- self.TRANSITION_ATTRIBUTE_TYPE_ACCEPT = 1
- self.TRANSITION_ATTRIBUTE_TYPE_REFUSE = 2
- self.TRANSITION_ATTRIBUTE_TYPE_OTHER = 3
- self.TRANSITION_INTERVENE_TYPE_DELIVER = 1
- self.TRANSITION_INTERVENE_TYPE_ADD_NODE = 2
- self.TRANSITION_INTERVENE_TYPE_ADD_NODE_END = 3
- self.TRANSITION_INTERVENE_TYPE_ACCEPT = 4
- self.TRANSITION_INTERVENE_TYPE_COMMENT = 5
- self.TRANSITION_INTERVENE_TYPE_DELETE = 6
- self.TRANSITION_INTERVENE_TYPE_CLOSE = 7
- self.TRANSITION_INTERVENE_TYPE_ALTER_STATE = 8
- self.TRANSITION_INTERVENE_TYPE_HOOK = 9
- self.TRANSITION_INTERVENE_TYPE_RETREAT = 10
- self.FIELD_TYPE_STR = 5
- self.FIELD_TYPE_INT = 10
- self.FIELD_TYPE_FLOAT = 15
- self.FIELD_TYPE_BOOL = 20
- self.FIELD_TYPE_DATE = 25
- self.FIELD_TYPE_DATETIME = 30
- self.FIELD_TYPE_RADIO = 35
- self.FIELD_TYPE_CHECKBOX = 40
- self.FIELD_TYPE_SELECT = 45
- self.FIELD_TYPE_MULTI_SELECT = 50
- self.FIELD_TYPE_TEXT = 55
- self.FIELD_TYPE_RICH_TEXT = 58
- self.FIELD_TYPE_USERNAME = 60
- self.FIELD_TYPE_MULTI_USERNAME = 70
- self.FIELD_TYPE_ATTACHMENT = 80
- self.FIELD_ATTRIBUTE_RO = 1
- self.FIELD_ATTRIBUTE_REQUIRED = 2
- self.FIELD_ATTRIBUTE_OPTIONAL = 3
- self.TICKET_PERMISSION_HANDLE = 1
- self.TICKET_PERMISSION_VIEW = 2
- self.TICKET_BASE_FIELD_LIST = ['id', 'sn', 'title', 'state_id', 'parent_ticket_id', 'parent_ticket_state_id',
- 'participant_type_id', 'participant', 'workflow_id', 'ticket_type_id',
- 'creator', 'is_deleted', 'gmt_created', 'gmt_modified', 'script_run_last_result']
- self.FIELD_VALUE_ENUM = {
- self.FIELD_TYPE_STR: 'char_value',
- self.FIELD_TYPE_INT: 'int_value',
- self.FIELD_TYPE_FLOAT: 'float_value',
- self.FIELD_TYPE_BOOL: 'bool_value',
- self.FIELD_TYPE_DATE: 'date_value',
- self.FIELD_TYPE_DATETIME: 'datetime_value',
- self.FIELD_TYPE_RADIO: 'radio_value',
- self.FIELD_TYPE_CHECKBOX: 'checkbox_value',
- self.FIELD_TYPE_SELECT: 'select_value',
- self.FIELD_TYPE_MULTI_SELECT: 'multi_select_value',
- self.FIELD_TYPE_TEXT: 'text_value',
- self.FIELD_TYPE_RICH_TEXT: 'text_value',
- self.FIELD_TYPE_USERNAME: 'username_value',
- self.FIELD_TYPE_MULTI_USERNAME: 'multi_username_value',
- self.FIELD_TYPE_ATTACHMENT: 'char_value'
- }
- self.NOTICE_TYPE_HOOK = 1
- self.NOTICE_TYPE_WECHAT_WORK = 2
- self.NOTICE_TYPE_DINGTALK = 3
- constant_service_ins = ConstantService()
|