|
|
@@ -19,6 +19,7 @@ import com.template.component.ParkingFeeSystemComponent;
|
|
|
import com.template.component.bo.AddVisitorCarBO;
|
|
|
import com.template.mapper.WelcomeVisitorMapper;
|
|
|
import com.template.model.pojo.WelcomeSetting;
|
|
|
+import com.template.model.pojo.WelcomeStudent;
|
|
|
import com.template.model.pojo.WelcomeVisitor;
|
|
|
import com.template.model.query.WelcomeVisitorQuery;
|
|
|
import com.template.model.request.WelcomeVisitorRequest;
|
|
|
@@ -63,8 +64,6 @@ public class WelcomeVisitorServiceImpl extends ServiceImpl<WelcomeVisitorMapper,
|
|
|
visitorRequest.setStudentCard(studentCard);
|
|
|
checkBeforeAdd(visitorRequest);
|
|
|
|
|
|
- // TODO 查询学生学费缴纳情况
|
|
|
-
|
|
|
// 新增访客记录
|
|
|
WelcomeVisitor visitor = new WelcomeVisitor();
|
|
|
BeanUtils.copyProperties(visitorRequest, visitor);
|
|
|
@@ -148,11 +147,16 @@ public class WelcomeVisitorServiceImpl extends ServiceImpl<WelcomeVisitorMapper,
|
|
|
|
|
|
// 校验身份证号是否存在
|
|
|
String studentCard = visitorRequest.getStudentCard();
|
|
|
- int existCount = studentService.countByStudentCard(studentCard);
|
|
|
- if (existCount <= 0) {
|
|
|
+ WelcomeStudent student = studentService.getByStudentCard(studentCard);
|
|
|
+ if (ObjectUtil.isNull(student)) {
|
|
|
throw new MyCustomException(ResponseStatusEnum.STUDENT_CAR_NUMBER_NOT_FOUNT);
|
|
|
}
|
|
|
|
|
|
+ // 查询学生学费缴纳情况 1:已缴费
|
|
|
+ if (!Integer.valueOf(1).equals(student.getIsPay())) {
|
|
|
+ throw new MyCustomException(ResponseStatusEnum.NOT_PAY);
|
|
|
+ }
|
|
|
+
|
|
|
// 查询当前用户是否已有访客记录
|
|
|
LambdaQueryWrapper<WelcomeVisitor> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(WelcomeVisitor::getStudentCard, studentCard);
|
|
|
@@ -161,8 +165,6 @@ public class WelcomeVisitorServiceImpl extends ServiceImpl<WelcomeVisitorMapper,
|
|
|
throw new MyCustomException(ResponseStatusEnum.EXISTS);
|
|
|
}
|
|
|
|
|
|
- // TODO 查询学生学费缴纳情况
|
|
|
-
|
|
|
// 校验车牌数量 4 固定写法
|
|
|
WelcomeSetting setting = settingService.getManageById("4");
|
|
|
int carNum;
|