package com.fjhx.service.contract;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.base.Condition;
import com.fjhx.base.StorageBaseService;
import com.fjhx.entity.contract.Contract;
import com.fjhx.entity.water.WaterTag;
import com.fjhx.params.apply.ApplyPurchaseVo;
import com.fjhx.params.contract.ContractVo;

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

/**
 * <p>
 * 采购合同 服务类
 * </p>
 *
 * @author ${author}
 * @since 2022-09-19
 */
public interface ContractService extends StorageBaseService<Contract> {

    void delete(ContractVo contractVo);

    /**
     * 生成合同
     *
     * @param applyVo 申购明细
     */
    void create(ApplyPurchaseVo applyVo);

    /**
     * 金额统计
     */
    Map<Integer, Map<String, Object>> amountStatistics(Condition condition);

    /**
     * 分页
     */
    Page<Map<String, Object>> getPage(Condition condition);

    /**
     * 列表
     */
    List<Map<String, Object>> getList(Condition condition);

    /**
     * 更新合同修正数量和修正金额
     *
     * @param qualityTestingId 质检id
     */
    void updateAdjustByQualityTestingId(Long qualityTestingId);

    /**
     * 更新合同退货数量和退货金额
     *
     * @param waterTagList 标签列表
     */
    void updateBackAmountAndQuantity(List<WaterTag> waterTagList);

}
