楊村長Vue3開源組件庫實(shí)戰(zhàn)(Vue3+Vite+VitePress+TSX+Tailwind)
? ?long count = this.count(paymentOrderLambdaQueryWrapper);
? ? ? ?//存在相同業(yè)務(wù)單號(hào)的付款單則拋異常
? ? ? ?if(count>0){
? ? ? ? ? ?throw new RuntimeException("不可重單");
? ? ? ?}else{
? ? ? ? ? ?//無重復(fù)數(shù)據(jù),創(chuàng)建付款單
? ? ? ? ? ?this.save(paymentOrder);
? ? ? ? ? ?//其他DB操作
? ? ? ? ? ?...
? ? ? ?}
? ?} finally {
? ? ? ? ? ?// 釋放鎖
? ? ? ? ? ?if (lock.isLocked() && lock.isHeldByCurrentThread()) {
? ? ? ? ? ? ? ?lock.unlock();
? ? ? ? ? ?}
? ?}}
標(biāo)簽: