package com.fjhx.purchase.service;

import com.fjhx.entity.purchase.PurchaseContract;
import com.fjhx.base.BaseService;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采购合同 服务类
 * </p>
 *
 * @author ${author}
 * @since 2022-07-14
 */
public interface PurchaseContractService extends BaseService<PurchaseContract> {

    /**
     * 校验是否为第一次购买此物料得供应商
     * @param supplierId
     * @param materialCode
     * @return
     */
    Long checkNewSupplier(String supplierId,String materialCode);

    /**
     * 上次面料采购
     * @return
     */
    PurchaseContract newPur(String materialCode);

    /**
     * 合同历史付款记录
     * @return
     */
    List<Map<String,Object>> historyPayList();

    /**
     * 获取历史付款列表
     * @param condition
     * @return
     */
    List<PurchaseContract> getPayList(Map<String,Object> condition) throws ParseException;

    /**
     * 获取历史付款列表--条数
     * @param condition
     * @return
     */
    Integer getPayListCount(Map<String,Object> condition);

    /**
     * 统计供应商总付款金额
     * @param condition
     * @return
     */
    List<Map<String,Object>> getPayGroupBySu(Map<String,Object> condition);

    /**
     * 获取总金额
     * @param date
     * @return
     */
    BigDecimal getSumMoney(String date);
}
