Browse Source

opt: 查询空框锁优化

master
yanps 5 months ago
parent
commit
00ae54b0dc
  1. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -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)

Loading…
Cancel
Save