纷享销客开发者手册 纷享销客开发者手册
  • APL开发手册
  • PWC开发手册
  • OpenAPI 文档
APL代码介绍
API Reference
开发工具
更新日志
  • 简体中文
  • English
APL代码介绍
API Reference
开发工具
更新日志
  • 简体中文
  • English
  • 入门

  • APL函数开放场景

  • APL类开放场景

    • 公共库

    • 电子签

    • 认证提供商

    • 可用业务类型

    • 对象Controller插件

    • 事件监听

    • 对象导出插件

      • 1.概述
      • 2.配置步骤
      • 3.Groovy代码示例
      • 4.常见问题
    • ERP集成平台

    • 外勤类型函数校验

    • 快消订货业务插件

    • 对象业务处理器

    • 在线文档

    • 自定义模型

    • 环境部署

Groovy代码示例

/**
 * @type classes
 * @returntype
 * @namespace object_export_plugin
 */
class ObjExpJ552Z implements ObjectExportPlugin {

    /**
     * 导出过程中加工需要导出的数据
     * 和需要导出的数据数量有关,可能会执行多次
     * @param context
     * @param arg
     * @return
     */
    ObjectExport.DoExportResult doExport(FunctionContext context, ObjectExport.DoExportArg arg) {
        def markStr = "******"
        log.info(context)
        log.info(arg)

        def objectApiName = arg.getObjectApiName()
        log.info(objectApiName)
        def markField = ""
        if ("object_l9WB3__c" == objectApiName) {
            markField = "field_zty92__c"
        }

        if ("object_o6sBx__c" == objectApiName) {
            markField = "field_GD6z1__c"
        }

        if ("object_w064j__c" == objectApiName) {
            markField = "field_x09r3__c"
        }
        // 原始的数据
        def originalDataList = arg.originalDataList
        // 导出用于展示的数据
        def displayDataList = arg.displayDataList

        // 给手机打掩码
        displayDataList.each {
            it[markField] = markStr
        }

        return ObjectExport.DoExportResult.builder()
                //将用于展示的字段返回
                .displayDataList(displayDataList)
                .build()
    }

    /**
     * 导出完成后调用一次
     * @param context
     * @param arg
     * @return
     */
    ObjectExport.AfterResult after(FunctionContext context, ObjectExport.AfterArg arg) {
        // 导出的对象
        def objectApiName = arg.getObjectApiName()
        // 导出的总条数
        def totalCount = arg.getTotalCount()
        log.info(context.tenantId)
        return null;
    }
}

2.配置步骤
4.常见问题

← 2.配置步骤 4.常见问题→

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式