Commit 75d80982 by xieshixiang

添加注释

parent 521c8360
......@@ -153,15 +153,25 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
@Override
public Response<ResultList<ViolationInfoRes>> violationInfo(BindInfoQuery query) {
/**
* 校验当前的绑定信息是否存在
*/
BindInfo bindInfo = mapper.selectById(query.getUnqId());
if (bindInfo == null || "0".equals(bindInfo.getStatus())) {
return ResponseGenerator.fail(StatusCode.DATA_ERROR);
}
/**
* 查询违章信息
*/
ViolationPlateNumAndTypeQueryReq req = new ViolationPlateNumAndTypeQueryReq();
req.setPlateNum(bindInfo.getPlateNum());
req.setPlateType(bindInfo.getPlateType());
List<ViolationRes> byPlateNumAndType = violatio.getByPlateNumAndType(req);
/**
* 构建违章信息返回列表
*/
List<ViolationInfoRes> violationInfoResList = new ArrayList<>();
for (ViolationRes res : byPlateNumAndType) {
ViolationInfoRes info = new ViolationInfoRes();
......@@ -177,17 +187,26 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
@Override
public Response<DrivingLicenseInfoRes> drivingLicenseInfo(BindInfoQuery query) {
/**
* 校验当前的绑定信息是否存在
*/
BindInfo bindInfo = mapper.selectById(query.getUnqId());
if (bindInfo == null || "0".equals(bindInfo.getStatus())) {
return ResponseGenerator.fail(StatusCode.DATA_ERROR);
}
/**
* 校验当前电话号码是否在10天内已通过验证
*/
VerifyInfo verifyInfo = this.verifyInfo.checkValidity(query.getPhone(), query.getUserId(),
DateUtil.offsetDay(DateTime.now(), -10));
if (verifyInfo == null) {
return ResponseGenerator.fail(StatusCode.PERMISSION_DENIED);
}
/**
* 根据车牌号和车牌类型查询车辆信息
*/
PlateNumAndTypeQueryReq vechicleInfoReq = new PlateNumAndTypeQueryReq();
vechicleInfoReq.setPlateType(bindInfo.getPlateType());
vechicleInfoReq.setPlateNum(bindInfo.getPlateNum());
......@@ -196,6 +215,9 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
return ResponseGenerator.fail(StatusCode.ALERT_ERROR);
}
/**
* 根据身份证号码查询驾照信息
*/
IdCardQueryReq idCardQueryReq = new IdCardQueryReq();
idCardQueryReq.setIdCard(byPlateNumAndType.getSfzmhm());
DrivingLicenseRes drivingLicenseRes = drivingLicense.getByIdCard(idCardQueryReq);
......@@ -203,6 +225,9 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
return ResponseGenerator.fail(StatusCode.ALERT_ERROR);
}
/**
* 构建驾照信息查询结果
*/
DrivingLicenseInfoRes result = new DrivingLicenseInfoRes();
result.setDriverName(drivingLicenseRes.getXm());
result.setPlateNum(drivingLicenseRes.getSfzmhm());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment