no message
parent
c09374c446
commit
be5a37012d
|
|
@ -156,7 +156,23 @@ public class PickServiceImpl extends ServiceImpl<PickMapper, Pick> implements IP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean allocatePickDetail(PickDetail pickDetail) {
|
public boolean allocatePickDetail(PickDetail pickDetail) {
|
||||||
|
String lockKey = "pickDetail:" + pickDetail.getPickId()+":"+pickDetail.getItemId();
|
||||||
|
String lockValue = null;
|
||||||
|
try {
|
||||||
|
lockValue = redissonLock.tryLock(lockKey, 10);
|
||||||
|
if (StringUtils.isEmpty(lockValue)) {
|
||||||
|
throw new RuntimeException("分配明细中,请稍后重试");
|
||||||
|
}
|
||||||
return allocateProcessor.allocatePickDetail(pickDetail);
|
return allocateProcessor.allocatePickDetail(pickDetail);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("分配明细异常", e);
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
|
if (StringUtils.isNotEmpty(lockValue)) {
|
||||||
|
redissonLock.unlock(lockKey, lockValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue