opt: 查询空框锁优化
This commit is contained in:
@@ -68,7 +68,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
private final String nameClass = "SchBasePoint";
|
||||
private final Object lock = new Object();
|
||||
|
||||
|
||||
@Override
|
||||
@@ -389,7 +389,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||
public SchBasePoint selectByEmptyCage(String region_code, String vehicle_type, String pointStatus, boolean isVehicle, SchBaseTask task) {
|
||||
synchronized (this.nameClass){
|
||||
synchronized (lock){
|
||||
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getIs_lock, false)
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
|
||||
Reference in New Issue
Block a user