package com.engine.organization.service;

import com.api.browser.bean.SearchConditionItem;
import com.engine.organization.entity.TopTab;
import weaver.hrm.User;

import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/24
 * @version: 1.0
 */
public interface ExtService {

    /**
     * 组装主表、主表拓展表表单
     *
     * @param user
     * @param extendType
     * @param tableName
     * @param viewAttr
     * @param id
     * @param groupId
     * @return
     */
    List<SearchConditionItem> getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId, String... readOnlyFields);

    /**
     * 组装主表新增表单
     *
     * @param user
     * @param extendType
     * @param tableName
     * @param viewAttr
     * @param groupId
     * @return
     */
    List<SearchConditionItem> getExtSaveForm(User user, String extendType, String tableName, int viewAttr, String groupId, String autoNoField, String serialType, Map<String, Object> params, String... readOnlyFields);

    /**
     * 组装明细表表单
     *
     * @param user
     * @param extendType
     * @param tableName
     * @param id
     * @param viewAttr
     * @param showLabel
     * @return
     */
    List<Map<String, Object>> getExtendTables(User user, String extendType, Long groupId, String tableName, long id, int viewAttr, boolean showLabel);
    /**
     * 拓展页面分组
     *
     * @param extendType
     * @param tableName
     * @return
     */
    List<TopTab> getTabInfo(String extendType, String tableName);


    /**
     * 更新主表拓展表
     *
     * @param user
     * @param extendType
     * @param tableName
     * @param params
     * @param groupId
     * @param id
     * @return
     */
    Long updateExtForm(User user, String extendType, String tableName, Map<String, Object> params, String groupId, Long id);

    /**
     * 更新明细表
     *
     * @param user
     * @param extendType
     * @param tableName
     * @param params
     * @param id
     */
    void updateExtDT(User user, String extendType, String tableName, Map<String, Object> params, Long id);
}
