fix: 送气胀轴加个锁
This commit is contained in:
@@ -395,15 +395,27 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
||||||
}
|
}
|
||||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||||
// 创建任务
|
RLock lockPoint = redissonClient.getLock(shafttubeivt.getPoint_code());
|
||||||
param.put("point_code1", deviceCode);
|
boolean tryLockPoint = lockPoint.tryLock(0, TimeUnit.SECONDS);
|
||||||
param.put("point_code2", shafttubeivt.getPoint_code());
|
try {
|
||||||
// hint: 当前分切计划的气涨轴尺寸
|
if (tryLockPoint) {
|
||||||
param.put("qzz_size", qzzSize);
|
// 创建任务
|
||||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
param.put("point_code1", deviceCode);
|
||||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
param.put("point_code2", shafttubeivt.getPoint_code());
|
||||||
param.put("is_bushing", "0");
|
// hint: 当前分切计划的气涨轴尺寸
|
||||||
trussCallShaftCacheTask.createTask(param);
|
param.put("qzz_size", qzzSize);
|
||||||
|
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
||||||
|
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
param.put("is_bushing", "0");
|
||||||
|
trussCallShaftCacheTask.createTask(param);
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (tryLockPoint) {
|
||||||
|
lockPoint.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
res.put("status", HttpStatus.HTTP_OK);
|
res.put("status", HttpStatus.HTTP_OK);
|
||||||
res.put("message", "请求成功");
|
res.put("message", "请求成功");
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user