package com.awspaas.user.apps.donenow_ctt;

import com.actionsoft.apps.listener.PluginListener;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AtFormulaPluginProfile;
import com.awspaas.user.apps.donenow_ctt.at.*;

import java.util.ArrayList;
import java.util.List;

public class Plugins implements PluginListener {
    /**
     *注册插件
     * @param appContext
     * @return
     */
    @Override
    public List<AWSPluginProfile> register(AppContext appContext) {
        List<AWSPluginProfile> list = new ArrayList<>();
        list.add(new AtFormulaPluginProfile("数据库", "@getProcessInstIdByBoId(*boName,*boId)", getProcessInstIdByBoId.class.getName(),
                "通过boId获取流程实例Id", "通过boId获取流程实例Id"));
        list.add(new AtFormulaPluginProfile("数据库", "@getFormField(*boName,*fieldName,*boIdOrBindid)", getFormField.class.getName(),
                "获取表单字段数据", "获取表单字段数据"));
        list.add(new AtFormulaPluginProfile("数据库", "@getSNListSql(*sql)", getFormField.class.getName(),
                "把输入的逗号分割sn字符串转换成SQL", "sql:查询语句或者字符串"));
        list.add(new AtFormulaPluginProfile("donenow合同", "@getPickSNListSql(*warehouseProductId,*quantity,*type)", getFormField.class.getName(),
                "合同产品拣货时获取产品序列号", "warehouseProductId:库存产品Id，quantity：拣货数量，type：1或2"));
        return list;
    }
}
