package com.yn.bftl.thirdparty.common.util;

import com.yn.bftl.common.common.entity.Sequence;
import com.yn.bftl.thirdparty.common.service.SequenceService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @ClassName SequenceController @Description TODO @Author GuoHongKai @Date 2021/7/5 16:56 @Version
 * 1.0
 */
@Component
public class SequenceUtil {

    @Resource
    private SequenceService sequenceService;

    public String getNextSequenceNumber(String sequenceCode) {
        Sequence sequence = sequenceService.getSequence(sequenceCode);
        if (sequence == null) {
            return null;
        }
        return sequenceService.getSequenceNumber(sequence);
    }
}
