package com.jwipc.sys.client.impl;

import com.jwipc.sys.client.DigitalSealBusinessDetailClient;
import com.jwipc.sys.client.convert.DigitalSealBusinessDetailClientConvert;
import com.jwipc.sys.client.dto.DigitalSealBusinessDetailParamClientDTO;
import com.jwipc.sys.convert.DigitalSealBusinessDetailConvert;
import com.jwipc.sys.logic.DigitalSealBusinessDetailLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author shenyang.ou
 * @date 2024/5/10 15:52
 * @desc
 */
@Service
@RequiredArgsConstructor
public class DigitalSealBusinessDetailClientImpl implements DigitalSealBusinessDetailClient {
    private final DigitalSealBusinessDetailLogic digitalSealBusinessDetailLogic;
    private final DigitalSealBusinessDetailClientConvert digitalSealBusinessDetailClientConvert;
    /**
     * 获取一条签署文件状态
     *
     * @param businessId 业务id
     * @return 签署状态；0-草稿；1-签署中；2-完成；3-已过期；4-已拒签；5-已作废；6-作废中
     */
    @Override
    public Integer getLimitSignStatus(Long businessId) {
        return digitalSealBusinessDetailLogic.getLimitSignStatus(businessId);
    }

    /**
     * 检查是否存在
     *
     * @param businessId       业务id
     * @param businessTypeCodes 业务类型
     * @return true-存在；false-不存在
     */
    @Override
    public boolean checkExist(Long businessId, String businessTypeCodes) {

        return digitalSealBusinessDetailLogic.checkExist(businessId,businessTypeCodes);
    }

    @Override
    public void save(DigitalSealBusinessDetailParamClientDTO paramClientDTO) {
        digitalSealBusinessDetailLogic.save(digitalSealBusinessDetailClientConvert.paramClientDTO2DTO(paramClientDTO));
    }
}
