Commit 1a211f73 by xieshixiang

Merge branch 'dev' into test

parents d6d4e822 78fdba4e
...@@ -82,14 +82,27 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i ...@@ -82,14 +82,27 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
return ResponseGenerator.fail(StatusCode.BUSINESS_ERROR, "同一用户下,最多绑定3辆车"); return ResponseGenerator.fail(StatusCode.BUSINESS_ERROR, "同一用户下,最多绑定3辆车");
} }
//规则:一个电话号码只能对应一个客户 //规则:一个客户只能绑定一个电话号码
if (list != null && list.size() > 0) { if (list != null && !list.isEmpty()) {
boolean equals = list.get(0).getPhone().equals(info.getPhone()); boolean equals = list.get(0).getPhone().equals(info.getPhone());
if (!equals) { if (!equals) {
return ResponseGenerator.fail(StatusCode.BUSINESS_ERROR, "当前客户手机号与历史绑定手机号不一致"); return ResponseGenerator.fail(StatusCode.BUSINESS_ERROR, "当前客户手机号与历史绑定手机号不一致");
} }
} }
//规则:一个电话号码只能被一个客户绑定
QueryWrapper<ParkBindInfo> phone = new QueryWrapper();
boundQuery.eq("phone", info.getUserId());
boundQuery.eq("status", "1");
List<ParkBindInfo> phones = mapper.selectList(boundQuery);
if (phones != null && !phones.isEmpty()) {
boolean equals = phones.get(0).getPhone().equals(info.getPhone());
if (!equals) {
return ResponseGenerator.fail(StatusCode.BUSINESS_ERROR, "当前手机号已被绑定");
}
}
//规则2:客户手机号与车辆对应的车主手机号一致 //规则2:客户手机号与车辆对应的车主手机号一致
PlateNumQueryReq req = new PlateNumQueryReq(); PlateNumQueryReq req = new PlateNumQueryReq();
req.setPlateNum(info.getPlateNum()); req.setPlateNum(info.getPlateNum());
......
...@@ -67,7 +67,6 @@ public class BindCache { ...@@ -67,7 +67,6 @@ public class BindCache {
@CacheEvict(value = "bindinfo", key = "'id:'+#unqId", condition = "#unqId!=null"), @CacheEvict(value = "bindinfo", key = "'id:'+#unqId", condition = "#unqId!=null"),
@CacheEvict(value = "bindinfo", key = "'userId:'+#userId", condition = "#userId!=null") @CacheEvict(value = "bindinfo", key = "'userId:'+#userId", condition = "#userId!=null")
}) })
public boolean unBind(String unqId, String userId) { public boolean unBind(String unqId, String userId) {
ParkBindInfo bindInfo = new ParkBindInfo(); ParkBindInfo bindInfo = new ParkBindInfo();
bindInfo.setUnqId(unqId); bindInfo.setUnqId(unqId);
......
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