package com.scm.contract.service.print;

import com.baomidou.mybatisplus.extension.api.R;
import com.scm.contract.dao.print.ReprintCodeDao;
import com.scm.contract.dao.print.ReprintCodeDetailDao;
import com.scm.contract.model.print.ReprintCodeDetail;
import com.scm.contract.model.print.SerialNumberRange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author zuo
 * @date 2024/6/25 16:34
 */
@Service
@Transactional(readOnly = true, rollbackFor = Exception.class)
public class ReprintCodeDetailService {

    @Autowired
    private ReprintCodeDetailDao dao;


    public List<SerialNumberRange> getSerialNumberRange(List<String> reprintCodeIds) {
        return dao.getSerialNumberRange(reprintCodeIds);
    }

    @Transactional
    public synchronized Boolean saveBash(List<ReprintCodeDetail> reprintCodeDetails) {
        return dao.saveBash(reprintCodeDetails);
    }

    public List<ReprintCodeDetail> getListByReprintCodeIds(List<String> reprintCodeIds) {
        return dao.getListByReprintCodeIds(reprintCodeIds);
    }

    public List<ReprintCodeDetail> getListByPrintCodeIds(List<String> printCodeIds) {
        return dao.getListByPrintCodeIds(printCodeIds);
    }

    public Boolean deleteByIds(List<String> Ids) {
        return dao.deleteByIds(Ids);
    }

    public Boolean deleteByReprintCodeId(String reprintCodeId) {
        return dao.deleteByReprintCodeId(reprintCodeId);
    }

}
