try {
// 加锁
lock.lock();
// 当前流水号+1
CeParSeqInf parSeqInf = parseqinfRepos.findOne(seqCde);
resetCurSeqNum(parSeqInf);
if (parSeqInf.getCurSeqNum().compareTo(BigDecimal.ONE) == 0) {
sequenceService.setSeq(parSeqInf.getSeqPreFix()+parSeqInf.getSeqCde(), parSeqInf.getCurSeqNum().longValue());
}
parSeqInf.setCurSeqNum(BigDecimal.valueOf(sequenceService.getNextSeq(parSeqInf.getSeqPreFix()+parSeqInf.getSeqCde())));
parSeqInf = parseqinfRepos.save(parSeqInf);
return generateSeqStr(parMap, parSeqInf);
} finally {
// 释放锁
lock.unlock();
}