if (Objects.isNull(uid)){ return AjaxResult.error("Uid 为空"); }
if (Objects.isNull(amsStudentQueueCheckIn.getStudentCard())){ return AjaxResult.error("身份证号为空"); }
if (Objects.isNull(amsStudentQueueCheckIn.getStudentEmergencyContactNumber())){ return AjaxResult.error("电话号为空"); } if (Objects.isNull(amsStudentQueueCheckIn.getStudentName())){ return AjaxResult.error("姓名为空"); }
if (Objects.isNull(amsStudentQueueCheckIn.getStudentGender())){ return AjaxResult.error("性别为空"); } StringBuilder stringBuilder = new StringBuilder(); String studentContactNumber = amsStudentQueueCheckIn.getStudentContactNumber(); List<AmsStudentQueueCheckIn> amsStudentQueueCheckIns1 = amsStudentQueueCheckInService.selectAmsStudentQueueCheckInList(new AmsStudentQueueCheckIn().setStudentContactNumber(studentContactNumber));
11:42:51.810 [restartedMain] INFO o.a.c.h.Http11NioProtocol - [log,173] - Initializing ProtocolHandler ["http-nio-8080"] 11:42:51.811 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [Connector[HTTP/1.1-8080]] to [INITIALIZED] 11:42:51.811 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardService[Tomcat]] to [INITIALIZED] 11:42:51.811 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardServer[-1]] to [INITIALIZED] 11:42:51.811 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardServer[-1]] to [STARTING_PREP] 11:42:51.811 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardServer[-1]] to [STARTING] 11:42:51.812 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [org.apache.catalina.deploy.NamingResourcesImpl@1dc49001] to [STARTING_PREP] 11:42:51.812 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [org.apache.catalina.deploy.NamingResourcesImpl@1dc49001] to [STARTING] 11:42:51.812 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [org.apache.catalina.deploy.NamingResourcesImpl@1dc49001] to [STARTED] 11:42:51.812 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardService[Tomcat]] to [STARTING_PREP] 11:42:51.812 [restartedMain] INFO o.a.c.c.StandardService - [log,173] - Starting service [Tomcat] 11:42:51.812 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardService[Tomcat]] to [STARTING] 11:42:51.813 [restartedMain] DEBUG o.a.c.u.LifecycleBase - [log,173] - Setting state for [StandardEngine[Tomcat]] to [STARTING_PREP] 11:42:51.813 [restartedMain] INFO o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/9.0.75]
String token = UUID.randomUUID().toString(); // 添加分布式锁 if (redisCache.tryAcquireLock("checkInQueue", token, 2, 10)){ AmsStudentQueueCheckIn amsStudentQueueCheckIns = amsStudentQueueCheckInService.selectAmsStudentQueueCheckInListMax(amsStudentQueueCheckIn.getStudentGender()); Long queuePosition = 0L; if (Objects.nonNull(amsStudentQueueCheckIns)){ queuePosition = amsStudentQueueCheckIns.getQueuePosition();
} amsStudentQueueCheckIn.setStudentStatus(1).setQueuePosition(queuePosition + 1L).setStudentUid(uid); int i = amsStudentQueueCheckInService.insertAmsStudentQueueCheckIn(amsStudentQueueCheckIn); // 释放分布式锁 redisCache.unlock("checkInQueue", token); if (i != 1){ return AjaxResult.error("排队预约失败!请重新填写"); }