package cn.ey.biz.module.weaver.api;

import cn.ey.biz.module.weaver.common.Constants;
import cn.ey.biz.module.weaver.common.RSP;
import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 流程数据：办结流程列表 (对外)
 *
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface GetProcessedWorkflowRequestListService {

    @RequestMapping(method= RequestMethod.POST, value="/api/workflow/paService/getProcessedWorkflowRequestList",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    RSP<ProcessedWorkflowResponse> getProcessedWorkflowRequestList(@RequestBody  ProcessedWorkflowRequest request);

    @Data
    class ProcessedWorkflowRequest{
        ProcessedWorkflowconditions  conditions;	//非必填	高级搜索条件
        boolean isMergeShow;	//非必填	是否主次账号统一显示	"true"
        boolean  isNeedO;	//非必填	是否显示异构系统数据 ， 为true时还需 设置开启异构系统显示才会显示	"true"
        String pageNo;		//非必填	要查询的为第几页的数据	"1"
        String pageSize;	//非必填	分页时一页多少数据	"10"
        String userId;	//非必填	要查询的用户id 和userType一起来定位要查询的用户，不传取当前登录用户	"11"
    }

    @Data
    class ProcessedWorkflowconditions{
        String  wfcode;
        String  ownerdepartmentid;
        String  requestname;
        String  nodetype;
        String  workcode;
        String  archivestatus;
        String  operatedateselect;
        String  recievedateselect;
        String  creatersubcompanyid;
        String  requestlevel;
        String  unophrmid ;
        String  docids;
        String  creatertype;
        String  proids ;
        String  crmids;
        String  craterid ;
        String  hrmcreaterid;
        String  createdateselect;
    }

    @Data
    class ProcessedWorkflowResponse{
        String createTime;		  //创建时间
        String creatorId;		 //创建人id
        String  creatorName;	 //创建人名称
        String currentNodeId;	 //当前节点id
        String currentNodeName;	 //当前节点名称
        String lastOperateTime;	 //最后操作时间
        String lastOperatorId;	 //最后操作人id
        String lastOperatorName;     //最后操作人名称
        String receiveTime;			 //接收时间
        String requestId;			 //请求id
        String requestLevel;		//紧急程度
        String requestName;			//请求名称
        String status;			 //路径状态
        String sysName;			 //系统名称 开了统一待办才会显示，并且受后台统一待办设置显示全称，简称，或不显示名称
        ProcessedWorkflowWorkflowBaseInfo workflowBaseInfo;	//流程基本信息
    }

    @Data
    class ProcessedWorkflowWorkflowBaseInfo{
        String  formId;
        String  workflowId;
        String  workflowName;
        String  workflowTypeId;
        String  workflowTypeName;
    }

}
