package com.scm.contract.service.print;

import com.scm.contract.dao.print.ReprintCodeDao;
import com.scm.contract.model.print.ReprintCode;
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 ReprintCodeService {

    @Autowired
    private ReprintCodeDao dao;

    @Transactional
    public synchronized Boolean save(ReprintCode reprintCode) {
        return dao.save(reprintCode);
    }

    public List<ReprintCode> getReprinting(Integer isPrint) {
        return dao.getReprinting(isPrint);
    }

    public List<ReprintCode> getListByIds(List<String> ids) {
        return dao.getListByIds(ids);
    }

    @Transactional
    public synchronized Boolean updatePrintBash(List<ReprintCode> reprintCodes) {
        return dao.updatePrintBash(reprintCodes);
    }

    public List<ReprintCode> getListBylApplicationIds(List<String> reprintLabelApplicationIds) {
        return dao.getListBylApplicationIds(reprintLabelApplicationIds);
    }

    public Boolean deleteById(String id) {
        return dao.deleteById(id);
    }
}
