package com.wd.workoffice.retrofit;


import com.alibaba.fastjson.JSONObject;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.Config;
import com.wd.workoffice.bean.ProDetail;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public interface ApiService {
    String DOMAIN = Config.DEBUG ? "http://zwang.bat100.net.cn:8000/" : "http://zwang.bat100.net.cn:8000/";

//    String DOMAIN = Config.DEBUG ? "http://121.36.41.111:9001/" : "http://121.36.41.111:9001/";


    /**
     * 用户注册
     *
     * @return
     */
    @POST("/open/sys/user/register")
    Observable<BaseBean> register(@Body RequestBody requestBody);

    /**
     * 登录
     * grant_type=userNew
     * grant_type=phone
     *
     * @return
     */
    @POST("/login")
    Call<BaseBean> login(@Query("grant_type") String type, @Body RequestBody requestBody);

    /**
     *
     *
     * @return
     */
    @POST("/oauth/token?grant_type=refresh_token")
    Call<JSONObject> refreshToken( @QueryMap Map<String, Object> param);

    /**
     * 退出登录
     *
     * @return
     */
    @POST("/authorities/logout")
    Observable<BaseBean> logout();

    /**
     * 激活员工前获取该员工信息
     *
     * @return
     */
    @GET("/open/pre-activation/{phone}")
    Observable<BaseBean> preActivationUser(@Path("phone") String phone);


    /**
     * 忘记密码（短信验证码的方式，重置密码）
     *
     * @return
     */
    @PUT("/open/change-pwd-forget")
    Observable<BaseBean> forgetPwd(@Query("phone") String phone,
                                   @Query("verifyCode") String verifyCode, @Query("newPassword") String newPassword);

    /**
     * 根据旧密码重置密码
     *
     * @return
     */
    @PUT("/sys/user/change-pwd")
    Observable<BaseBean> modifyPwd(@Query("oldPassword") String oldPassword,
                                   @Query("newPassword") String newPassword);

    /**
     * 发送短信验证码
     *
     * @param phone
     * @param type: login、register、alterPwd
     * @return
     */
    @GET("/open/sms/ckCode/{phone}")
    Observable<BaseBean> code(@Path("phone") String phone, @Query("type") String type);

    /**
     * 验证验证码
     *
     * @param phone
     * @return
     */
    @GET("/open/verify-sms-code")
    Observable<BaseBean> verifyCode(@Query("phone") String phone,
                                    @Query("verifyCode") String verifyCode, @Query("type") String type);

    /**
     * 激活员工前获取该员工信息
     *
     * @return
     */
    @GET("/open/pre-activation/{phone}")
    Observable<BaseBean> getInfo(@Path("phone") String phone);

    /**
     * 激活用户
     *
     * @return
     */
    @PUT("/open/activation-user")
    Observable<BaseBean> activation(@Body RequestBody requestBody);


    /**
     * 部门列表
     *
     * @return
     */
    @GET("/open/sys/dept/list")
    Observable<BaseBean> depList();
    /**
     * 部门列表
     *
     * @return
     */
    @POST("/sys/dept")
    Observable<BaseBean> addDep(@Body RequestBody requestBody);

    /**
     * 根据权限 获取生产厂
     *
     * @return
     */
    @GET("/sub-process/dept-list")
    Observable<BaseBean> getDepByPermission(@Query("permission") String permission);

    /**
     * 根据部门、流程、往来单位获取子流程
     *
     * @param processCode
     * @param transitPartId 往来单位id(客戶id)
     * @return
     */
    @GET("/sub-process/listByDPT")
    Observable<BaseBean> getProcess(@Query("processCode") String processCode, @Query("transitPartId") Integer transitPartId);

    /**
     * 根据往来单位的类别 获取当前用户所维护的往来单位列表
     * <p>
     * name
     * partTypeCode partTypeCode:SUPPLIER-供应商
     * * CUSTOMER-客户
     * * TRANSPORTERS-运输商
     *
     * @return
     */
    @GET("/transitpart/page/list/current-user/part-type")
    Observable<BaseBean> getClient(@QueryMap Map<String, Object> param);

    /**
     * 搜索往来单位（回款申请，）
     * <p>
     * name
     * partTypeCode partTypeCode:SUPPLIER-供应商
     * * CUSTOMER-客户
     * * TRANSPORTERS-运输商
     *
     * @return
     */
    @GET("/transitpart/search-list")
    Observable<BaseBean> getClientOut(@QueryMap Map<String, Object> param);

    /**
     * 根据关联往来单位（类别为客户）和生产厂（产品上架部门） --> 获取产品列表
     * <p>
     * outDeptId
     * transitPartId 销售订单（客户id），外采购订单（供应商id）
     * <p>
     * processType 销售流程PROCESS_SALE
     * 外采购流程PROCESS_PURCHAS
     *
     * @return
     */
    @GET("product/page/list/by/outDept/transit-part")
    Observable<BaseBean> getProductList(@QueryMap Map<String, Object> param);

    /**
     * 仓库
     * <p>
     * deptId
     * customerId
     * sign       固定值send
     * 供应   参数是3个
     * 坩埚的话  内部交易一个参数 deptId
     *
     * @return
     */
    @GET("/stock/search-list")
    Observable<BaseBean> getStock(@QueryMap Map<String, Object> param);


    /**
     * 用户信息
     *
     * @return
     */
    @GET("/sys/user/userInfo")
    Observable<BaseBean> userInfo();

    /**
     * 订单
     * <p>
     * orderStatus app端订单筛选：
     * 100：待审核
     * 200：待接单
     * 710： 待生产 （已接单、申请提前结束）
     * 500：已入库
     * 600： 已交付
     * 960：已关闭 （审核失败、已拒单、已提前结束）
     * identity    1:作为买家(销售部门) 2:作为卖家(生产部门)
     *
     * @return
     */
    @GET("/saleOrder/current-user/page/list")
    Observable<BaseBean> getOrder(@QueryMap Map<String, Object> param);

    /**
     * 外采购订单
     * <p>
     * orderStatus app端订单筛选：
     * 100：待审核
     * 200：待接单
     * 300 + 410 = 710： 待生产 （已接单、申请提前结束）
     * 500：已入库
     * 600： 已交付
     * 220 + 320 + 420 = 960 ：已关闭 （审核失败、已拒单、已提前结束）
     * identity    1:作为买家(销售部门) 2:作为卖家(生产部门)
     *
     * @return
     */
    @GET("/purchaseOrder/current-user/page/list")
    Observable<BaseBean> getOutOrder(@QueryMap Map<String, Object> param);

    /**
     * 内部
     * <p>
     * orderStatus app端订单筛选：
     * 100：待审核
     * 200：待接单
     * 300 + 410 = 710： 待生产 （已接单、申请提前结束）
     * 500：已入库
     * 600： 已交付
     * 220 + 320 + 420 = 960 ：已关闭 （审核失败、已拒单、已提前结束）
     * identity    1:作为买家(销售部门) 2:作为卖家(生产部门)
     *
     * @return
     */
    @GET("/insideOrder/current-user/page/list")
    Observable<BaseBean> getInsideOrder(@QueryMap Map<String, Object> param);

    /**
     * 供应订单
     * <p>
     * orderStatus app端订单筛选：
     * 100：待审核
     * 200：待接单
     * 300 + 410 = 710： 待生产 （已接单、申请提前结束）
     * 500：已入库
     * 220 + 320 + 420 = 960 ：已关闭 （审核失败、已拒单、已提前结束）
     * identity    1:作为买家(销售部门) 2:作为卖家(生产部门)
     *
     * @return
     */
    @GET("/supplierOrder/current-user/page/list")
    Observable<BaseBean> getSupplierOrder(@QueryMap Map<String, Object> param);

    /**
     * 订单
     * <p>
     * orderStatus app端订单筛选：
     * 100：待审核
     * 200：待接单
     * 710： 待生产 （已接单、申请提前结束）
     * 500：已入库
     * 600： 已交付
     * 960：已关闭 （审核失败、已拒单、已提前结束）
     * identity    1:作为买家(销售部门) 2:作为卖家(生产部门)
     *
     * @return
     */
    @GET("/crucibleOrder/current-user/page/list")
    Observable<BaseBean> getCucibleOrder(@QueryMap Map<String, Object> param);

    /**
     * 订单
     * <p>
     * orderStatus app端订单筛选：
     * 100：待审核
     * 200：待接单
     * 710： 待生产 （已接单、申请提前结束）
     * 500：已入库
     * 600： 已交付
     * 960：已关闭 （审核失败、已拒单、已提前结束）
     * identity    1:作为买家(销售部门) 2:作为卖家(生产部门)
     *
     * @return
     */
    @GET("/crucibleSaleOrder/current-user/page/list")
    Observable<BaseBean> getCucibleSaleOrder(@QueryMap Map<String, Object> param);


    /**
     * 产品列表
     * <p>
     * processType
     * ofKind      产品种类SM:自制成品OS:外购贴牌RM:原料
     * statu 冻结标记0冻结1正常
     * isExpectOut  是否上架true:上架false:未上架
     * searchValue 模糊搜索（图号、名称）
     *
     * @return
     */
    @GET("/product/app/page/list")
    Observable<BaseBean> getPro(@QueryMap Map<String, Object> param);

    /**
     * 产品详情
     * transitPartRelList 往来单位关联
     * partTypeCode： SUPPLIER-供应商 CUSTOMER-客户 TRANSPORTERS-运输商
     * name：往来单位名称
     * address：往来单位地址
     * accountName：负责人
     * deptName：负责部门
     * outDeptRelList 上架情况
     * createdTime：上架时间
     * deptName：上架部门
     * outByUserName：上架操作人
     *
     * @return
     */
    @GET("/product/app/detail/{productId}")
    Observable<ProDetail> getProDetail(@Path("productId") String id);

    /**
     * 产品详情
     * productId
     * current
     * size
     *
     * @return
     */
    @GET("/product-price-change/page/list")
    Observable<BaseBean> getProHistoryPrice(@QueryMap Map<String, Object> param);

    /**
     * 产品详情
     * internalPrice 价格（内部价格）
     * id
     * remark
     *
     * @return
     */
    @PUT("/product/price")
    Observable<BaseBean> modifyProPrice(@Body RequestBody requestBody);


    /**
     * 上下架
     * shelfAction
     * id
     *
     * @return
     */
    @PUT("/product/app/shelf")
//    Observable<BaseBean> onSalePro(@Body RequestBody requestBody);
    Observable<BaseBean> onSalePro(@QueryMap Map<String, Object> param);

    /**
     * 下单
     * <p>
     * customerId 客户ID
     * launchUserId 下单用户ID
     * launchDeptId	下单部门ID
     * receiveDeptId	接单部门ID
     * launchOrderAmount下单总金额
     * subProcessId	子流程ID
     * expandInfo 第二层:订单扩展信息
     * 备注: 第二层:订单扩展信息
     * <p>
     * orderItems
     *
     * @return
     */
    @POST("saleOrder/start")
    Observable<BaseBean> submitSaleOrder(@Body RequestBody requestBody);

    /**
     * 下单
     * <p>
     * customerId 客户ID
     * launchUserId 下单用户ID
     * launchDeptId	下单部门ID
     * receiveDeptId	接单部门ID
     * launchOrderAmount下单总金额
     * inStockId	入库仓库id
     * expandInfo 第二层:订单扩展信息
     * 备注: 第二层:订单扩展信息
     * <p>
     * orderItems
     *
     * @return
     */
    @POST("/crucibleOrder/start")
    Observable<BaseBean> submitCrucibleOrder(@Body RequestBody requestBody);

    @POST("/crucibleSaleOrder")
    Observable<BaseBean> submitCrucibleSaleOrder(@Body RequestBody requestBody);

    /**
     * 下单
     * <p>
     * launchUserId 下单用户ID
     * launchDeptId	下单部门ID
     * receiveDeptId	接单部门ID
     * launchOrderAmount下单总金额
     * inStockId	入库仓库id
     * expandInfo 第二层:订单扩展信息
     * 备注: 第二层:订单扩展信息
     * <p>
     * orderItems
     *
     * @return
     */
    @POST("/supplierOrder/start")
    Observable<BaseBean> submitSupplierOrder(@Body RequestBody requestBody);

    /**
     * 下单
     * <p>
     * launchUserId 下单用户ID
     * launchDeptId	下单部门ID
     * receiveDeptId	接单部门ID
     * launchOrderAmount下单总金额
     * inStockId	入库仓库id
     * expandInfo 第二层:订单扩展信息
     * 备注: 第二层:订单扩展信息
     *
     * <p>
     * orderItems
     * type 类别 (暂时使用product)
     * product(产品)
     * service(服务)
     *
     * @return
     */
    @POST("/insideOrder/start")
    Observable<BaseBean> submitInsideOrder(@Body RequestBody requestBody);

    /**
     * 下单
     * <p>
     * launchUserId 下单用户ID
     * launchDeptId	下单部门ID
     * receiveDeptId	接单部门ID
     * launchOrderAmount下单总金额
     * inStockId	入库仓库id
     * expandInfo 第二层:订单扩展信息
     * customerId
     * supplierId
     * subProcessId
     * 备注: 第二层:订单扩展信息
     *
     * <p>
     * orderItems
     *
     * @return
     */
    @POST("/purchaseOrder/start")
    Observable<BaseBean> submitPurchaseOrder(@Body RequestBody requestBody);

    @POST("/procedureStart/ao/applyPackage")
    Observable<BaseBean> submitProcedureOrder(@Body RequestBody requestBody);

    /**
     * 获取客户分厂
     *
     * @param param
     * @return
     */
    @GET("/customer-branch-factory/page/init")
    Observable<BaseBean> getClientFactory(@QueryMap Map<String, Object> param);

    /**
     * app端往来单位分页列表
     *
     * @param param
     * @return
     */
    @GET("/transitpart/app/page/list")
    Observable<BaseBean> getContacts(@QueryMap Map<String, Object> param);

    /**
     * 部门信息
     *
     * @return
     */
    @GET("/dept-account-balance/app/account-balance-info")
    Observable<BaseBean> getAccount();

    /**
     * 获取部门账户的流水
     *
     * @param param
     * @return
     */
    @GET("/finance/flow/page/list")
    Observable<BaseBean> getFlow(@QueryMap Map<String, Object> param);

    /**
     * 仓库
     *
     * @param param stockTypeId 库存类别id
     *              status 1：启用 0：停用
     *              isShowByDateDesc 是否按时间倒叙展示
     *              siteType IN：厂内库 OUT：场外库
     *              searchKey 按名称模糊搜索时，该参数为name
     *              searchValue 模糊搜索的关键字
     * @return
     */
    @GET("/stock/page/list")
    Observable<BaseBean> getWarehouse(@QueryMap Map<String, Object> param);

    /**
     * 仓库
     *
     * @param param stockTypeId 库存类别id
     *              status 1：启用 0：停用
     *              isShowByDateDesc 是否按时间倒叙展示
     *              siteType IN：厂内库 OUT：场外库
     *              searchKey 按名称模糊搜索时，该参数为name
     *              searchValue 模糊搜索的关键字
     * @return
     */
    @GET("/stockQuantity/app/page/listOfOrder")
    Observable<BaseBean> getWareHouseOrder(@QueryMap Map<String, Object> param);

    /**
     * 获取部门列表（不分页）
     *
     * @param param includeCO  1包含集团和冻结部门 0：不包含集团和冻结部门(int)
     *              includeFreeze   包含冻结部门 0：不包含冻结部门(int)
     *              name
     * @return
     */
    @GET("/sys/dept/list")
    Observable<BaseBean> getDep(@QueryMap Map<String, Object> param);

    /**
     * 获取部门详情
     *
     * @param id
     * @return
     */
    @GET("/sys/dept/{deptId}")
    Observable<BaseBean> getDepDetail(@Path("deptId") String id);

    /**
     * 分页查询仓库类别信息
     *
     * @return
     */
    @GET("/stockType/app/search/list")
    Observable<BaseBean> getStockType(@QueryMap Map<String, Object> param);

    /**
     * 查看往来单位详情
     *
     * @return
     */
    @GET("/transitpart/{id}")
    Observable<BaseBean> contactInfo(@Path("id") String id);

    /**
     * app端从往来单位进入查看收票单
     *
     * @return
     */
    @GET("/receiptInvoiceApply/app/page/list/part")
    Observable<BaseBean> receiveTicket(@QueryMap Map<String, Object> param);

    /**
     * app端从往来单位进入查看开票单
     *
     * @return
     */
    @GET("/invoiceApply/app/page/list/part")
    Observable<BaseBean> openTicket(@QueryMap Map<String, Object> param);

    /**
     * /销售订单开票
     *
     * @return
     */
    @GET("/invoiceApply/so/page/list")
    Observable<BaseBean> openSoTicket(@QueryMap Map<String, Object> param);

    /**
     * 组装订单开票申请分页列表
     *
     * @return
     */
    @GET("/invoiceApply/ao/page/list")
    Observable<BaseBean> openAoTicket(@QueryMap Map<String, Object> param);

    /**
     * 外采购订单开票申请分页列表
     *
     * @return
     */
    @GET("/invoiceApply/po/page/list")
    Observable<BaseBean> openPoTicket(@QueryMap Map<String, Object> param);

    /**
     * 坩埚订单开票申请分页列表
     *
     * @return
     */
    @GET("/invoiceApply/co/page/list")
    Observable<BaseBean> openCoTicket(@QueryMap Map<String, Object> param);

    /**
     * so开票审核
     *
     * @return
     */
    @PUT("/invoiceApply/so/exam")
    Observable<BaseBean> soExam(@Body RequestBody requestBody);

    /**
     * ao开票审核
     *
     * @return
     */
    @PUT("/invoiceApply/ao/exam")
    Observable<BaseBean> aoExam(@Body RequestBody requestBody);

    /**
     * po开票审核
     *
     * @return
     */
    @PUT("/invoiceApply/po/exam")
    Observable<BaseBean> poExam(@Body RequestBody requestBody);

    /**
     * co开票审核
     *
     * @return
     */
    @PUT("/invoiceApply/co/exam")
    Observable<BaseBean> coExam(@Body RequestBody requestBody);

    /**
     * Fo收票审核
     *
     * @return
     */
    @PUT("/receiptInvoiceApply/fo/exam")
    Observable<BaseBean> receiveFoExam(@Body RequestBody requestBody);

    /**
     * po收票审核
     *
     * @return
     */
    @PUT("/receiptInvoiceApply/po/exam")
    Observable<BaseBean> receivePoExam(@Body RequestBody requestBody);

    /**
     * so开票申请
     *
     * @return
     */
    @POST("/invoiceApply/so")
    Observable<BaseBean> soApply(@Body RequestBody requestBody);


    /**
     * fo开票申请
     *
     * @return
     */
    @POST("/invoiceApply/ao")
    Observable<BaseBean> aoApply(@Body RequestBody requestBody);


    /**
     * po开票申请
     *
     * @return
     */
    @POST("/invoiceApply/po")
    Observable<BaseBean> poApply(@Body RequestBody requestBody);


    /**
     * co开票申请
     *
     * @return
     */
    @POST("/invoiceApply/co")
    Observable<BaseBean> coApply(@Body RequestBody requestBody);

    /**
     * fo开票申请
     *
     * @return
     */
    @POST("/receiptInvoiceApply/fo")
    Observable<BaseBean> foReceipApply(@Body RequestBody requestBody);

    /**
     * po开票申请
     *
     * @return
     */
    @POST("/receiptInvoiceApply/po")
    Observable<BaseBean> poReceiptApply(@Body RequestBody requestBody);


    /**
     * 外采购收票分页列表
     *
     * @return
     */
    @GET("/receiptInvoiceApply/po/page/list")
    Observable<BaseBean> receivePoTicket(@QueryMap Map<String, Object> param);


    /**
     * 供应收票申请管理
     *
     * @return
     */
    @GET("/receiptInvoiceApply/fo/page/list")
    Observable<BaseBean> receiveFoTicket(@QueryMap Map<String, Object> param);

    /**
     * 库存数量：一个仓库里的产品列表
     *
     * @return
     */
    @GET("/stockQuantity/app/page/list")
    Observable<BaseBean> stockList(@QueryMap Map<String, Object> param);

    /**
     * 库存数量明细：一个仓库下一个产品里的订单列表
     *
     * @return
     */
    @GET("/stockQuantityDetail/app/page/list")
    Observable<BaseBean> stockDetail(@QueryMap Map<String, Object> param);

    /**
     * 库存数量流水
     *
     * @return
     */
    @GET("/stockQuantityFlow/page/list")
    Observable<BaseBean> stockFlow(@QueryMap Map<String, Object> param);

    /**
     * 库存数量明细流水
     *
     * @return
     */
    @GET("/stockQuantityDetailFlow/page/list")
    Observable<BaseBean> stockDetailFlow(@QueryMap Map<String, Object> param);

    /**
     * 一个订单的详情[从订单列表进入]
     *
     * @return
     */
    @GET("/stockQuantity/app/oneOfOrder/{orderId}")
    Observable<BaseBean> stockDetailFlow(@Path("orderId") String id, @Query("orderType") String orderType);

    /**
     * 获取当前用户的角色，数据、部门权限列表
     *
     * @return
     */
    @GET("/privilege/detail")
    Observable<BaseBean> permissionDetail();

    /**
     * 回款管理
     *
     * @return
     */
    @GET("/moneyBackApply/page/list")
    Observable<BaseBean> moneyBack(@QueryMap Map<String, Object> param);

    /**
     * 付款申请-分页查询
     *
     * @return
     */
    @GET("/moneyPayApply/page/list")
    Observable<BaseBean> moneyPay(@QueryMap Map<String, Object> param);

    /**
     * 获取所有部门账户列表（分页）
     *
     * @return
     */
    @GET("/dept-account-balance/page/list")
    Observable<BaseBean> account(@QueryMap Map<String, Object> param);


    /**
     * app端冻结解冻当前用户所在部门的可用余额
     * action冻结(1)解冻(-1)动作判断
     * amount操作金额（冻结解冻可用余额）
     *
     * @return
     */
    @PUT("/dept-account-balance/balance")
    Observable<BaseBean> freezeOrUnfreezeBalanceShelf(@Body RequestBody requestBody);

    /**
     * n 获取运费开票申请分页列表
     *
     * @return
     */
    @GET("/finance-logistics-apply/page/list")
    Observable<BaseBean> logistic(@QueryMap Map<String, Object> param);


    /**
     * 发票明细列表
     *
     * @return
     */
    @GET("/invoice-apply/item/list")
    Observable<BaseBean> ticketDetail(@Query("applyId") String applyId);

    /**
     * 发票明细列表
     *
     * @return
     */
    @GET("/receiptInvoiceApplyItem/list")
    Observable<BaseBean> ticketReceiveDetail(@Query("applyId") String applyId);

    /**
     * 获取运费开票详情（开票的运费记录）
     *
     * @return
     */
    @GET("/finance-logistics-apply/detail/page/list")
    Observable<BaseBean> logisticsDetail(@Query("applyId") String applyId);

    /**
     * 审批开票申请
     * id
     * status  未处理：0       通过：1       驳回：2
     * remark
     * invoiceNumber
     *
     * @return
     */
    @PUT("/finance-logistics-apply")
    Observable<BaseBean> logisticsCheck(@Body RequestBody requestBody);


    /**
     * 回款申请
     * orderType
     * applyAmount
     * applyDept
     * customerId
     * process
     * applyRemark
     *
     * @return
     */
    @POST("/moneyBackApply/apply")
    Observable<BaseBean> moneyBackApply(@Body RequestBody requestBody);

    /**
     * 付款申请
     * orderType
     * applyAmount
     * applyDept
     * customerId
     * process
     * applyRemark
     *
     * @return
     */
    @POST("/moneyPayApply/apply")
    Observable<BaseBean> moneyPayApply(@Body RequestBody requestBody);

    /**
     * 审批回款
     * orderType
     * applyAmount
     * applyDept
     * customerId
     * process
     * applyRemark
     *
     * @return
     */
    @PUT("/moneyBackApply/exam")
    Observable<BaseBean> checkMoneyBack(@Body RequestBody requestBody);

    /**
     * 付款回款
     * orderType
     * applyAmount
     * applyDept
     * customerId
     * process
     * applyRemark
     *
     * @return
     */
    @PUT("/moneyPayApply/exam")
    Observable<BaseBean> checkMoneyPay(@Body RequestBody requestBody);


    /**
     * 为开票查询的订单
     * customerId
     * launchDeptId
     * searchValue
     *
     * @return
     */
    @GET("/saleOrder/forInvoice")
    Observable<BaseBean> saleTicketOrder(@QueryMap Map<String, Object> param);

    /**
     * 为组装查询的订单
     * customerId
     * launchDeptId
     * searchValue
     *
     * @return
     */
    @GET("/package-order/item/page/list")
    Observable<BaseBean> packageTicketOrder(@QueryMap Map<String, Object> param);


    /**
     * 为外采购查询的订单
     * customerId
     * launchDeptId
     * searchValue
     *
     * @return
     */
    @GET("/purchaseOrder/forInvoice")
    Observable<BaseBean> purchaseTicketOrder(@QueryMap Map<String, Object> param);

    /**
     * /**
     * 坩埚订单
     * customerId
     * launchDeptId
     * searchValue
     *
     * @return
     */
    @GET("/crucibleSaleOrder/forInvoice")
    Observable<BaseBean> crucibleTicketOrder(@QueryMap Map<String, Object> param);


    /**
     * 外采购订单
     * customerId
     * launchDeptId
     * searchValue
     *
     * @return
     */
    @GET("/purchaseOrder/item/page/list")
    Observable<BaseBean> purchaseOutTicketOrder(@QueryMap Map<String, Object> param);

    /**
     * 供应订单
     * customerId
     * launchDeptId
     * searchValue
     *
     * @return
     */
    @GET("/supplierOrder/item/page/list")
    Observable<BaseBean> supplierTicketOrder(@QueryMap Map<String, Object> param);

    /**
     * app查看某一往来单位的应收或应付账款
     * transitPartId
     * type
     * AR：应收 AP应付(String)
     * searchValue
     *
     * @return
     */
    @GET("/finance-dept-ar-ap-part-detail/app/page/list")
    Observable<BaseBean> contactsMoney(@QueryMap Map<String, Object> param);

    /**
     * 物流账单
     * transitPartId
     * type
     * AR：应收 AP应付(String)
     * searchValue
     *
     * @return
     */
    @GET("/finance-logistics/page/list")
    Observable<BaseBean> contactsMoneyLogistic(@QueryMap Map<String, Object> param);

    /**
     * 物流账单
     * transitPartId
     * type
     * AR：应收 AP应付(String)
     * searchValue
     *
     * @return
     */
    @GET("/finance-logistics-flow/page/list")
    Observable<BaseBean> contactsMoneyLogisticFlow(@QueryMap Map<String, Object> param);

    /**
     * 部门应收应付账款流水
     *
     * @return
     */
    @GET("/finance-dept-ar-ap-part/flow/page/list")
    Observable<BaseBean> contactsMoneyFlow(@QueryMap Map<String, Object> param);

    /**
     * 部门应收应付账款流水
     *
     * @return
     */
    @GET("/finance-logistics-log/page/list")
    Observable<BaseBean> contactsLogistic(@QueryMap Map<String, Object> param);

    /**
     * 部门应收应付账款流水
     *
     * @return
     */
    @POST("/finance-logistics-apply")
    Observable<BaseBean> logisticsApply(@Body RequestBody requestBody);


    /**
     * 获取财税分页
     *
     * @return
     */
    @PUT("/finance-tax/cancel/{id}")
    Observable<BaseBean> storeFinancialCancel(@Path("id")String id);

    /**
     * 获取财税分页
     *
     * @return
     */
    @GET("/finance-tax/page/list")
    Observable<BaseBean> storeFinancial(@QueryMap Map<String, Object> param);
    /**
     * 获取财税明细
     *
     * @return
     */
    @GET("/finance-tax/detail/{taxId}")
    Observable<BaseBean> storeFinancialDetail(@Path("taxId")String id);

    /**
     * 获取财税明细
     *
     * @return
     */
    @PUT("/finance-tax/audit")
    Observable<BaseBean> storeFinancialCheck(@Body RequestBody requestBody);

    /**
     * 财税类别
     *
     * @return
     */
    @GET("finance-tax-type/listByDept/{deptId}")
    Observable<BaseBean> financialType(@Path("deptId")String deptId);

    /**
     * 新增财税
     *
     * @return
     */
    @POST("/finance-tax/addApply")
    Observable<BaseBean> addFinancial(@Body RequestBody requestBody);


    /**
     * 修改个人信息,头像和用户名（app）
     *
     * @return
     */
    @Multipart
    @POST("/open/uploadImgs")
    Observable<JSONObject> upload(@Part MultipartBody.Part avatar);

    /**
     * 取产品源(获取退货仓库产品数量)
     *
     * @return
     */
    @GET("/stockQuantity/return-stock/page/list")
    Observable<BaseBean> tradingPro(@QueryMap Map<String, Object> param);

    /**
     * 获取产品去向(搜索置换产品)
     *
     * @return
     */
    @GET("/product/search-list")
    Observable<BaseBean> tradingProDialog(@Query("soleCode") String soleCode);

    /**
     * 获取产品去向(搜索置换产品)
     *
     * @return
     */
    @GET("/package-order/app/page/list")
    Observable<BaseBean> productList(@QueryMap Map<String, Object> param);

    /**
     * 获取产品去向(搜索置换产品)
     *
     * @return
     */
    @GET("/packageApply/app/page/list")
    Observable<BaseBean> productApplyList(@QueryMap Map<String, Object> param);

    /**
     *
     * @return
     */
    @GET("/saleOrder/oneInfo/{orderId}")
    Observable<BaseBean> saleOrderDetail(@Path("orderId") String orderId, @Query("type") String type);

    /**
     *
     * @return
     */
    @GET("/package-order/oneInfo/{orderId}")
    Observable<BaseBean> productOrderDetail(@Path("orderId") String orderId, @Query("type") String type);

    /**
     *
     * @return
     */
    @GET("/purchaseOrder/oneInfo/{orderId}")
    Observable<BaseBean> purchaseOrderDetail(@Path("orderId") String orderId, @Query("type") String type);
    /**
     *
     * @return
     */
    @GET("/insideOrder/oneInfo/{orderId}")
    Observable<BaseBean> insideOrderDetail(@Path("orderId") String orderId, @Query("type") String type);
    /**
     *
     * @return
     */
    @GET("/crucibleOrder/oneInfo/{orderId}")
    Observable<BaseBean> crucibleOrderDetail(@Path("orderId") String orderId, @Query("type") String type);
    /**
     *
     * @return
     */
    @GET("/crucibleSaleOrder/oneInfo/{orderId}")
    Observable<BaseBean> crucibleSaleOrderDetail(@Path("orderId") String orderId, @Query("type") String type);

    /**
     *
     * @return
     */
    @GET("/supplierOrder/oneInfo/{orderId}")
    Observable<BaseBean> supplierOrderDetail(@Path("orderId") String orderId, @Query("type") String type);
    /**
     * 获取发货申请分页列表
     *
     * @return
     */
    @GET("/send-out-store-apply/page/list")
    Observable<BaseBean> sendApplyList(@QueryMap Map<String, Object> param);

    /**
     * 获取发货申请分页列表
     *
     * @return
     */
    @GET("send-out-store-apply/po/page/list")
    Observable<BaseBean> sendPoApplyList(@QueryMap Map<String, Object> param);
    /**
     * 获取发货申请分页列表
     *
     * @return
     */
    @GET("send-out-store-apply/co/page/list")
    Observable<BaseBean> sendCoApplyList(@QueryMap Map<String, Object> param);

    /**
     * 审批发货申请
     *
     * @return
     */
    @PUT("/send-out-store-apply/status")
    Observable<BaseBean> sendApplyCheck(@Body RequestBody requestBody);
    /**
     * 审批发货申请
     *
     * @return
     */
    @PUT("/send-out-store-apply/co/status")
    Observable<BaseBean> sendCoApplyCheck(@Body RequestBody requestBody);
    /**
     * 审批发货申请
     *
     * @return
     */
    @PUT("/send-out-store-apply/po/status")
    Observable<BaseBean> sendPoApplyCheck(@Body RequestBody requestBody);

    /**
     * _3获取发货申请详细信息列表
     *
     * @return
     */
    @GET("/send-out-store-apply/item/list")
    Observable<BaseBean> sendApplyDetail(@Query("applyId") String applyId);

    /**
     * _step6_1发起发货申请
     *
     * @return
     */
    @POST("/procedureStart/so/applyOutStock/{orderId}")
    Observable<BaseBean> sendApply(@Path("orderId") String orderId, @Body RequestBody requestBody);

    /**
     * _step6_1发起发货申请
     *
     * @return
     */
    @POST("/procedureStart/co/applyOutStock/{orderId}")
    Observable<BaseBean> sendCoApply(@Path("orderId") String orderId, @Body RequestBody requestBody);

    /**
     * _step6_1发起发货申请
     *
     * @return
     */
    @POST("/procedureStart/po/applyOutStock/{orderId}")
    Observable<BaseBean> sendPoApply(@Path("orderId") String orderId, @Body RequestBody requestBody);
    /**
     * _step5_1-发起提前结束申请
     *
     * @return
     */
    @POST("/procedureStart/so/applyAdvanceFinish/{orderId}")
    Observable<BaseBean> endApply(@Path("orderId") String orderId, @Body RequestBody requestBody);

    /**
     * step5_3-一个订单的提前结束历史记录
     *
     * @return
     */
    @GET("/advance-finish-apply/so/logs/{orderId}")
    Observable<BaseBean> endApplyList(@Path("orderId") String orderId, @QueryMap Map<String, Object> param);

    /**
     * step5_32-发送销售订单领用申请
     *
     * @return
     */
    @POST("/procedureStart/so/applyUse/{orderId}")
    Observable<BaseBean> useApplyAdd(@Path("orderId") String orderId, @Body RequestBody requestBody);
    /**
     * step5_32-发送销售订单领用申请
     *
     * @return
     */
    @POST("/procedureStart/ao/applyUse/{orderId}")
    Observable<BaseBean> useAoApplyAdd(@Path("orderId") String orderId, @Body RequestBody requestBody);

    /**
     * step8_1-领用申请分页查询
     *
     * @return
     */
    @GET("/useApply/so/page/list")
    Observable<BaseBean> useApply(@QueryMap Map<String, Object> param);

    /**
     * step8_1-领用申请分页查询
     *
     * @return
     */
    @GET("/useApply/ao/page/list")
    Observable<BaseBean> useAoApply(@QueryMap Map<String, Object> param);

    /**
     * step8_3-领用申请审核
     *
     * @return
     */
    @PUT("/useApply/so/audit/{applyId}")
    Observable<BaseBean> useApplyCheck(@Path("applyId") String applyId, @Body RequestBody requestBody);
    /**
     * step8_3-领用申请审核
     *
     * @return
     */
    @PUT("/useApply/ao/audit/{applyId}")
    Observable<BaseBean> useAoApplyCheck(@Path("applyId") String applyId, @Body RequestBody requestBody);

    /**
     * step7_7-退货申请流水列表
     *
     * @return
     */
    @GET("/returnApply/so/page/list")
    Observable<BaseBean> returnApplyList(@QueryMap Map<String, Object> param);
    /**
     * step7_7-退货申请流水列表
     *
     * @return
     */
    @GET("/returnApply/po/page/list")
    Observable<BaseBean> returnPoApplyList(@QueryMap Map<String, Object> param);

    /**
     * step4_1-发起入库申请
     *
     * @return
     */
    @POST("/procedureStart/so/applyStock/{orderItemId}")
    Observable<BaseBean> addStockApplyAdd(@Path("orderItemId") String orderItemId, @Body RequestBody requestBody);

    /**
     * step4_1-发起入库申请
     *
     * @return
     */
    @POST("/procedureStart/co/applyStock/{orderItemId}")
    Observable<BaseBean> addStockCoApplyAdd(@Path("orderItemId") String orderItemId, @Body RequestBody requestBody);
    /**
     * step4_1-发起入库申请
     *
     * @return
     */
    @POST("/procedureStart/io/applyStock/{orderItemId}")
    Observable<BaseBean> addStockIoApplyAdd(@Path("orderItemId") String orderItemId, @Body RequestBody requestBody);
    /**
     * step4_1-发起入库申请
     *
     * @return
     */
    @POST("/procedureStart/fo/applyStock/{orderItemId}")
    Observable<BaseBean> addFoStockApplyAdd(@Path("orderItemId") String orderItemId, @Body RequestBody requestBody);

    /**
     * step4_1-发起入库申请
     *
     * @return
     */
    @POST("/procedureStart/po/applyStock/{orderItemId}")
    Observable<BaseBean> addPoStockApplyAdd(@Path("orderItemId") String orderItemId, @Body RequestBody requestBody);

    /**
     * 入库申请列表
     *
     * @return
     */
    @GET("/enterStoreApply/so/app/page/list")
    Observable<BaseBean> addStockApplyList(@QueryMap Map<String, Object> param);
    /**
     * s入库申请列表
     *
     * @return
     */
    @GET("/enterStoreApply/fo/app/page/list")
    Observable<BaseBean> addFoStockApplyList(@QueryMap Map<String, Object> param);

    /**
     * s入库申请列表
     *
     * @return
     */
    @GET("/enterStoreApply/co/app/page/list")
    Observable<BaseBean> addCoStockApplyList(@QueryMap Map<String, Object> param);
    /**
     * s入库申请列表
     *
     * @return
     */
    @GET("/enterStoreApply/io/app/page/list")
    Observable<BaseBean> addIoStockApplyList(@QueryMap Map<String, Object> param);
    /**
     * step4_3-入库申请列表
     *
     * @return
     */
    @GET("/enterStoreApply/po/app/page/list")
    Observable<BaseBean> addPoStockApplyList(@QueryMap Map<String, Object> param);

    /**
     * /step4_2-入库申请审核
     *
     * @return
     */
    @PUT("/enterStoreApply/po/audit/{id}")
    Observable<BaseBean> addPoStockApplyCheck(@Path("id") String id, @Body RequestBody requestBody);
    /**
     * step4_2-入库申请审核
     *
     * @return
     */
    @PUT("/enterStoreApply/so/audit/{id}")
    Observable<BaseBean> addStockApplyCheck(@Path("id") String id, @Body RequestBody requestBody);
    /**
     * step4_2-入库申请审核
     *
     * @return
     */
    @PUT("/enterStoreApply/fo/audit/{id}")
    Observable<BaseBean> addFoStockApplyCheck(@Path("id") String id, @Body RequestBody requestBody);
    /**
     * step4_2-入库申请审核
     *
     * @return
     */
    @PUT("/enterStoreApply/co/audit/{id}")
    Observable<BaseBean> addCoStockApplyCheck(@Path("id") String id, @Body RequestBody requestBody);
    /**
     * step4_2-入库申请审核
     *
     * @return
     */
    @PUT("/enterStoreApply/io/audit/{id}")
    Observable<BaseBean> addIoStockApplyCheck(@Path("id") String id, @Body RequestBody requestBody);

    /**
     * 质检申请列表
     *
     * @return
     */
    @GET("/enterStoreApply/fo/app/quality-inspection/page/list")
    Observable<BaseBean> enterStoreApplyList(@QueryMap Map<String, Object> param);


    /**
     * 质检审核
     *
     * @return
     */
    @PUT("/enterStoreApply/fo/quality-inspection/audit/{id}")
    Observable<BaseBean> enterFoStoreApplyList(@Path("id") String id, @Body RequestBody requestBody);

    /**
     * 获取一个订单子表的全部流水
     *
     * @return
     */
    @GET("/orderFlow/orderItem/allFlows/{orderItemId}")
    Observable<BaseBean> orderItemFlow(@Path("orderItemId") String orderItemId);

    /**
     * step2-审核
     *
     * @return
     */
    @PUT("/saleOrder/audit/{orderId}")
    Observable<BaseBean> saleOrderCheck(@Path("orderId") String orderId,@Body RequestBody requestBody);

    /**
     * step2-审核
     *
     * @return
     */
    @PUT("/supplierOrder/audit/{orderId}")
    Observable<BaseBean> supplierOrderCheck(@Path("orderId") String orderId,@Body RequestBody requestBody);

    /**
     * step2-审核
     *
     * @return
     */
    @PUT("/insideOrder/audit/{orderId}")
    Observable<BaseBean> insideOrderCheck(@Path("orderId") String orderId,@Body RequestBody requestBody);
    /**
     * step2-审核
     *
     * @return
     */
    @PUT("/purchaseOrder/audit/{orderId}")
    Observable<BaseBean> purchaseOrderCheck(@Path("orderId") String orderId,@Body RequestBody requestBody);
    /**
     * step2-审核
     *
     * @return
     */
    @PUT("/crucible/audit/{orderId}")
    Observable<BaseBean> crucibleOrderCheck(@Path("orderId") String orderId,@Body RequestBody requestBody);

    /**
     * *获取当前用户某类消息
     *
     * @return
     */
    @GET("/notice-message-item/page/init")
    Observable<BaseBean> msg(@QueryMap Map<String, Object> param);
    /**
     * *把未读标记为已读
     *
     * @return
     */
    @POST("/notice-message-item/has_read")
    Observable<BaseBean> msgRead(@Body RequestBody requestBody);

    /**
     * *把未读标记为已读
     *
     * @return
     */
    @GET("/notice-message-item/content")
    Observable<BaseBean> msgContent(@Query("id") String id);

    /**
     * 设置入库方式
     *
     * @return
     */
    @PUT("/purchaseOrder/enter-stock-type")
    Observable<BaseBean> purchaseOrderStockType(@QueryMap Map<String, Object> param);
    /**
     * 2组装来源列表
     *
     * @return
     */
    @GET("/saleOrder/item/page/list")
    Observable<BaseBean> saleOrderPro(@QueryMap Map<String, Object> param);

    /**
     * 3获取当前客户可组装成品(分页)
     *
     * @return
     */
    @GET("/product/can-package/page/list")
    Observable<BaseBean> saleOrderTargetPro(@QueryMap Map<String, Object> param);

    /**
     * 3获取当前客户可组装成品(分页)
     *
     * @return
     */
    @GET("/package-end/item/list")
    Observable<BaseBean> packageEndPro(@Query("applyId") Integer id);
    /**
     * 3获取当前客户可组装成品(分页)
     *
     * @return
     */
    @GET("/package-source/item/list")
    Observable<BaseBean> packageSourcePro(@Query("applyId") Integer id);

    /**
     * 8组装申请审批
     *
     * @return
     */
    @PUT("/packageApply/exam/{applyId}")
    Observable<BaseBean> packageApply(@Path("applyId") String id,@Body RequestBody requestBody);


    /**
     * 待我审核&&已审核
     *
     * @return
     */
    @GET("/biz-approval/page/list")
    Observable<BaseBean> bizApproval(@QueryMap Map<String, Object> param);

    /**
     * 我发起的审批
     *
     * @return
     */
    @GET("/biz-approval/by-me")
    Observable<BaseBean> bizMeApproval(@QueryMap Map<String, Object> param);

    /**
     * 分页查询公告信息
     *
     * @return
     */
    @GET("/back/noticeAnnounce/page")
    Observable<BaseBean> notice(@QueryMap Map<String, Object> param);

    /**
     * 获取单条公告内容
     *
     * @return
     */
    @GET("/back/noticeAnnounce/{id}")
    Observable<BaseBean> noticeDetail(@Path("id") String id);


}
