上传的图像用于项目: 'CST技术支持'
  1. CST技术支持
  2. SLAL2-2314

【PRO-丰通UAT】用python code 创建 审批人的获取规则

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202104
    • F-丰田通商-
    •  UAT环境 内网访问: http://hr_test.toyotsu-ea.com 前台账号密码:system/1qazXDR% 后台账号密码:admin/admin
    • 基础通用功能
    • 隐藏

      1、
      if self.employee_id.department_id.manager_id != self.employee_id:
      result = self.employee_id.department_id.manager_id
      elif self.employee_id.department_id.manager_id == self.employee_id and self.employee_id.department_id.organization_level_id.code != 'organization_level_1':
      result = self.employee_id.department_id.parent_department_id.manager_id
      else:
      result = None
      2、
      if self.employee_id.department_id.manager_id != self.employee_id:
      result = self.employee_id.department_id.parent_department_id.manager_id
      elif self.employee_id.department_id.manager_id == self.employee_id and self.employee_id.department_id.parent_department_id.organization_level_id.code != 'organization_level_1':
      result = self.employee_id.department_id.parent_department_id.parent_department_id.manager_id
      else:
      result = None
      3、
      if self.employee_id.department_id.manager_id != self.employee_id:
      result = self.employee_id.department_id.manager_id
      elif self.employee_id.department_id.parent_department_id.manager_id and self.employee_id.department_id.parent_department_id.manager_id != self.employee_id:
      result = self.employee_id.department_id.parent_department_id.manager_id
      elif self.employee_id.department_id.parent_department_id.parent_department_id.manager_id and self.employee_id.department_id.parent_department_id.parent_department_id.manager_id != self.employee_id:
      result = self.employee_id.department_id.parent_department_id.parent_department_id.manager_id
      else:
      result = None
      if result:
      if result.department_id.organization_level_id.code not in ['organization_level_2','organization_level_3','organization_level_4']:
      result = None

      显示
      1、 if self.employee_id.department_id.manager_id != self.employee_id: result = self.employee_id.department_id.manager_id elif self.employee_id.department_id.manager_id == self.employee_id and self.employee_id.department_id.organization_level_id.code != 'organization_level_1': result = self.employee_id.department_id.parent_department_id.manager_id else: result = None 2、 if self.employee_id.department_id.manager_id != self.employee_id: result = self.employee_id.department_id.parent_department_id.manager_id elif self.employee_id.department_id.manager_id == self.employee_id and self.employee_id.department_id.parent_department_id.organization_level_id.code != 'organization_level_1': result = self.employee_id.department_id.parent_department_id.parent_department_id.manager_id else: result = None 3、 if self.employee_id.department_id.manager_id != self.employee_id: result = self.employee_id.department_id.manager_id elif self.employee_id.department_id.parent_department_id.manager_id and self.employee_id.department_id.parent_department_id.manager_id != self.employee_id: result = self.employee_id.department_id.parent_department_id.manager_id elif self.employee_id.department_id.parent_department_id.parent_department_id.manager_id and self.employee_id.department_id.parent_department_id.parent_department_id.manager_id != self.employee_id: result = self.employee_id.department_id.parent_department_id.parent_department_id.manager_id else: result = None if result: if result.department_id.organization_level_id.code not in ['organization_level_2','organization_level_3','organization_level_4'] : result = None

      1. 直属领导:先判断员工本人是不是部门负责人,如果不是,那么就找本部门负责人;
      如果员工本人是部门负责人,则找上级部门负责人审批;
      注意:部门层级若为一级,则跳过;

      2. 上层领导: 先判断员工本人是不是部门负责人,如果不是,那么就找上级部门负责人审批;
      如果员工本人是部门负责人,则找上上级部门负责人审批
      注意:部门层级若为一级,则跳过;

      3.合同续签流程的北京、上海、天津,的负责人:
      通过依次找他的部门负责人,上级部门负责人,上级的上级部门负责人,是本人就跳过,不是就判断职位是否大于等于部长(通过部门的层级判断:若层级位于四级、三级、二级,则为是),若是的话就由他审批。

            wenqiang.liu 刘文强
            weijing.liu 刘伟静
            表决:
            0 为这个问题表决

              创建日期:
              已更新:
              已解决: