package ink.wgink.module.activiti.service.oa;

import ink.wgink.module.activiti.pojo.vos.oa.UpdateTaskAssigneeVO;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList;

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

/**
 * @ClassName: IOAFormReportService
 * @Description: OA表单上报
 * @Author: wanggeng
 * @Date: 2022/3/22 22:05
 * @Version: 1.0
 */
public interface IOaFormReportService {

    String KEY_FORM_CODE = "formCode";
    String KEY_FORM_VERSION = "formVersion";
    String KEY_REPORT_UID = "reportUid";
    String KEY_MAIN_TITLE = "MAIN_TITLE";
    String KEY_ASSIGNEE_USER = "assigneeUser";
    String KEY_ASSIGNEE_USER_NAME = "assigneeUserName";
    String KEY_START_ASSIGNEE_USER = "startAssigneeUser";
    String KEY_ASSIGNEES = "assignees";
    String KEY_SELECT_TYPE = "selectType";
    String KEY_IS_NEXT_END_EVENT = "isNextEndEvent";
    String KEY_RECORD_FIELDS = "recordFields";
    /**
     * 抄送
     */
    String KEY_CCS = "ccs";
    /**
     * 文号列表
     */
    String KEY_DOC_NOS = "docNos";
    String KEY_REASON = "reason";
    /**
     * 签批关键字后缀
     */
    String EDIT_SIGN_KEY_SUFFIX = "Sign";
    /**
     * 会签关键字后缀
     */
    String EDIT_JOINTLY_SIGN_KEY_SUFFIX = "JointlySign";

    /**
     * 保存表单
     *
     * @param processDefinitionId 流程定义ID
     * @param formCode            表单编码
     * @param formVersion         表单版本
     * @param params              表单参数
     */
    void save(String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 保存表单
     *
     * @param token
     * @param processDefinitionId
     * @param formCode
     * @param formVersion
     * @param params
     */
    void saveByToken(String token, String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 保存表单
     *
     * @param userId
     * @param userName
     * @param processDefinitionId
     * @param formCode
     * @param formVersion
     * @param params
     */
    void saveByUserIdAndUserName(String userId, String userName, String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 更新表单
     *
     * @param taskId
     * @param formCode
     * @param formVersion
     * @param isNeedClaim 是否需要认领
     * @param uid
     * @param params
     */
    void update(String taskId, String formCode, Integer formVersion, Integer isNeedClaim, String uid, Map<String, Object> params);

    /**
     * 更新表单
     *
     * @param token
     * @param taskId
     * @param formCode
     * @param formVersion
     * @param isNeedClaim
     * @param uid
     * @param params
     */
    void updateByToken(String token, String taskId, String formCode, Integer formVersion, Integer isNeedClaim, String uid, Map<String, Object> params);

    /**
     * 更新表单
     *
     * @param userId
     * @param userName
     * @param taskId
     * @param formCode
     * @param formVersion
     * @param isNeedClaim
     * @param uid
     * @param params
     */
    void updateByUserIdAndUserName(String userId, String userName, String taskId, String formCode, Integer formVersion, Integer isNeedClaim, String uid, Map<String, Object> params);

    /**
     * 更新回退
     *
     * @param processInstanceId
     * @param currentTaskId
     * @param jumpNodeId
     * @param reason            错误原因
     */
    void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, String reason);

    /**
     * 更新回退
     *
     * @param token
     * @param processInstanceId
     * @param currentTaskId
     * @param jumpNodeId
     * @param reason
     */
    void updateGoBack(String token, String processInstanceId, String currentTaskId, String jumpNodeId, String reason);

    /**
     * 更新回退
     *
     * @param userId
     * @param userName
     * @param processInstanceId
     * @param currentTaskId
     * @param jumpNodeId
     * @param reason
     */
    void updateGoBackByUserIdAndUserName(String userId, String userName, String processInstanceId, String currentTaskId, String jumpNodeId, String reason);

    /**
     * 强制结束
     *
     * @param processInstanceId
     * @param currentTaskId
     * @param reason
     */
    void updateForcedEnd(String processInstanceId, String currentTaskId, String reason);

    /**
     * 强制结束
     *
     * @param token
     * @param processInstanceId
     * @param currentTaskId
     * @param reason
     */
    void updateForcedEnd(String token, String processInstanceId, String currentTaskId, String reason);

    /**
     * 强制结束
     *
     * @param userId
     * @param userName
     * @param processInstanceId
     * @param currentTaskId
     * @param reason
     */
    void updateForcedEndByUserIdAndUserName(String userId, String userName, String processInstanceId, String currentTaskId, String reason);

    /**
     * 更新任务
     *
     * @param processInstanceId
     * @param taskId
     * @param updateTaskAssigneeVO
     */
    void updateTaskAssignee(String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO);

    /**
     * 更新任务
     *
     * @param token
     * @param processInstanceId
     * @param taskId
     * @param updateTaskAssigneeVO
     */
    void updateTaskAssignee(String token, String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO);

    /**
     * 更新任务
     *
     * @param userId
     * @param userName
     * @param processInstanceId
     * @param taskId
     * @param updateTaskAssigneeVO
     */
    void updateTaskAssigneeByUserIdAndUserName(String userId, String userName, String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO);

    /**
     * 表单详情
     *
     * @param formCode
     * @param formVersion
     * @param uid
     * @return
     */
    Map<String, Object> get(String formCode, Integer formVersion, String uid);

    /**
     * 表单详情
     *
     * @param formCode
     * @param formVersion
     * @param uid
     * @return
     */
    Map<String, Object> getPO(String formCode, Integer formVersion, String uid);

    /**
     * 列表
     *
     * @param formCode
     * @param formVersion
     * @param params
     * @return
     */
    List<Map<String, Object>> list(String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 列表
     *
     * @param formCode    表单编码
     * @param formVersion 表单版本
     * @param uids        uie列表
     * @return
     */
    List<Map<String, Object>> list(String formCode, Integer formVersion, List<String> uids);

    /**
     * 分页列表
     *
     * @param formCode
     * @param formVersion
     * @param page
     * @return
     */
    SuccessResultList<List<Map<String, Object>>> listPage(String formCode, Integer formVersion, ListPage page);

}
