/**
 * @filename:ContractFileServiceImpl 2024-09-04
 * @project KJT v1.0.0 Copyright(c) 2024 wanglang Co. Ltd. All right reserved.
 */
package com.trade.service.trade.salescontract.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.trade.common.constant.HttpStatus;
import com.trade.common.exception.ServiceException;
import com.trade.service.trade.salescontract.domain.ContractFile;
import com.trade.service.trade.salescontract.mapper.ContractFileMapper;
import com.trade.service.trade.salescontract.service.ContractFileService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description:合同文件信息服务实现
 * @version: v1.0.0
 * @author: wanglang
 */
@Service
public class ContractFileServiceImpl extends ServiceImpl<ContractFileMapper, ContractFile> implements ContractFileService {

    @Override
    public List<ContractFile> selectBySignFlowId(String signFlowId) {
        List<ContractFile> list = this.lambdaQuery().eq(ContractFile::getSignFlowId, signFlowId).list();
        if (CollUtil.isEmpty(list)) {
            throw new ServiceException("未找到签署文件信息", HttpStatus.BAD_REQUEST);
        }
        return list;
    }
}
