版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...

代码块
languagepy
class PrivateAPIService(BasePrivateApiService):

    def execute(self, **kwargs):
        page_index = kwargs.get("page_index") or 1
        page_size = kwargs.get("page_size") or 100
        operate_time = kwargs.get("operate_time")
        if not operate_time:
            operate_time = datetime.datetime.now().strftime("%Y-%m-%d") + " 00:00:00"
        api_param = {"model": "OrgDepartmentHistory",
                     "page_index": page_index,
                     "page_size": page_size,
                     "filter_dict": {"operate_time": {"gte": operate_time},
                                     "org_type": [10, 20]},
                     "extra_property": {
                         "sorts": [{"key": "id", "type": "asc"}],
                         "fields": [{"field": ["origin_id"]},
                                    {"field": ["begin_date"]},
                                    {"field": ["end_date"]},
                                    {"field": ["org_type"]},
                                    {"field": ["number"]},
                                    {"field": ["name"]},
                                    {"field": ["org_full_name"]},
                                    {"field": ["parent_id"]},
                                    {"field": ["subordinate_unit_id"]},
                                    {"field": ["enabled"]},
                                    {"field": ["operate_time"]}]}}
        result = CustomerUtil.call_open_api("hcm.model.list", api_param)
        return result

    def log(self, content):
        return
        CustomerUtil.call_open_api("hcm.model.create",
                                   {"model": "SyncOuterRecord",
                                    "info": {"company_id": CustomerUtil.get_current_context().company.id,
                                             "name": self.__class__.__name__,
                                             "category": self.__class__.__name__,
                                             "type": 1,
                                             "content": str(content),
                                             "update_time": datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}})