package com.iformall.service;

import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxFlowConfig;
import com.iformall.domain.po.WxFlowModel;
import com.iformall.domain.po.WxFlowRecord;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author luozukai
 * 流程审批服务
 */
public interface WxFlowService {
    WxFlowModel getModelByType(int flowType,String tenantId);

    /**
     * 更新业务数据状态
     * @param mapInfo
     * @param applyStatus
     */
    void updateBusinessStatus(Map<String, Object> mapInfo,Integer applyStatus);

    ResultData getTaskStatusList(Long businessId,String tenantId);

    /**
     * 启动流程
     * @param params
     * @return
     */
    ResultData start(Map<String, Object> params,Long userId,String userName,String tenantId);

    /**
     * 分页代办列表
     * @param flowType
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResultData list(String flowType,Integer pageNum, Integer pageSize,Long userId,String tenantId);

    /**
     * 审批历史
     * @param businessId
     * @return
     */
    ResultData applyHistory(Long businessId,String tenantId);

    /**
     * 审批
     * @param params
     * @return
     */
    ResultData apply(@RequestBody Map<String, String> params,Long userId,String userName,String tenantId);

    /**
     * 驳回
     * @param params
     * @return
     */
    ResultData reject(@RequestBody Map<String, Object> params,Long userId,String userName,String userPhone,String tenantId);

    /**
     * 撤回
     * @param params
     * @return
     */
    ResultData setBack(Map<String, Object> params,Long userId,String userName);

    /**
     * 我的申请列表
     * @param pageSize
     * @return
     */
    PageInfo<WxFlowRecord> listAsPage(WxFlowRecord record, Integer pageIndex, Integer pageSize);

    /**
     * 我的审批
     * @param pageSize
     * @return
     */
    PageInfo<WxFlowRecord> myHandelList(WxFlowRecord record, Integer pageIndex, Integer pageSize);

    /**
     * 创建模板
     * @return
     */
    ResultData createModel(WxFlowModel wxFlowModel);

    /**
     * 查询模板
     * @return
     */
    ResultData findModelById(WxFlowModel wxFlowModel);

    /**
     * 删除模板
     * @return
     */
    ResultData delModel(WxFlowModel wxFlowModel);

    /**
     * 模板列表
     * @return
     */
    PageInfo<WxFlowModel> modelList(WxFlowModel wxFlowModel,Integer pageIndex, Integer pageSize);

    /**
     * 配置列表
     * @return
     */
    PageInfo<WxFlowConfig> configList(WxFlowConfig wxFlowConfig, Integer pageIndex, Integer pageSize);

    /**
     * 类型配置
     * @return
     */
    ResultData updateConfig(WxFlowConfig wxFlowConfig);

    /**
     * 根据业务查询模板
     * @return
     */
    List<WxFlowModel> getModelBybusiness(WxFlowModel wxFlowModel);
}
