Commit 6f0e4e6d by xieshixiang

Merge remote-tracking branch 'origin/dev' into dev

parents 5bc1596f 9c16def2
...@@ -25,6 +25,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.ViolationInfo ...@@ -25,6 +25,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.ViolationInfo
import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes; import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -56,6 +57,13 @@ public class H5Controller { ...@@ -56,6 +57,13 @@ public class H5Controller {
DefaultConverter defaultConverter; DefaultConverter defaultConverter;
/** /**
* 验证有效性限制时间
* 单位:小时
*/
@Value("${biz.check.validity.limit.time:24}")
Integer checkValidityLimitTime;
/**
* 年检信息查询接口 * 年检信息查询接口
* *
* @param query * @param query
...@@ -127,7 +135,7 @@ public class H5Controller { ...@@ -127,7 +135,7 @@ public class H5Controller {
public Response<CheckValidityRes> checkValidity(@RequestBody @Validated H5BindInfoQuery query) { public Response<CheckValidityRes> checkValidity(@RequestBody @Validated H5BindInfoQuery query) {
ParkVerifyInfo verifyInfo = verifyInfoMapper.checkValidity(query.getPhone(), query.getUserId(), ParkVerifyInfo verifyInfo = verifyInfoMapper.checkValidity(query.getPhone(), query.getUserId(),
DateUtil.offsetDay(DateTime.now(), -1)); DateUtil.offsetHour(DateTime.now(), -checkValidityLimitTime));
CheckValidityRes checkValidityRes = new CheckValidityRes(); CheckValidityRes checkValidityRes = new CheckValidityRes();
defaultConverter.getMapperFacade().map(query, checkValidityRes); defaultConverter.getMapperFacade().map(query, checkValidityRes);
......
...@@ -77,7 +77,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i ...@@ -77,7 +77,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
* 解除绑定时间限制 * 解除绑定时间限制
* 单位:小时 * 单位:小时
*/ */
@Value("${biz.unbind.time:-720}") @Value("${biz.unbind.time:720}")
Integer unBindTime; Integer unBindTime;
...@@ -156,12 +156,16 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i ...@@ -156,12 +156,16 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Response unbindInfo(UnBindReq req) { public Response unbindInfo(UnBindReq req) {
ParkBindInfo bindInfo = bindCache.getById(req.getUnqId());
if (bindInfo == null || "0".equals(bindInfo.getStatus())) {
return ResponseGenerator.fail(StatusCode.DATA_ERROR, "绑定信息不存在");
}
/** /**
* 解绑规则:30天内,同一客户解绑次数总计不能超过10次 * 解绑规则:30天内,同一客户解绑次数总计不能超过10次
*/ */
QueryWrapper<ParkBindInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<ParkBindInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", req.getUserId()); queryWrapper.eq("user_id", req.getUserId());
queryWrapper.ge("unbind_time", DateUtil.offsetHour(new Date(), unBindTime)); queryWrapper.ge("unbind_time", DateUtil.offsetHour(new Date(), -unBindTime));
queryWrapper.eq("status", "0"); queryWrapper.eq("status", "0");
Integer integer = mapper.selectCount(queryWrapper); Integer integer = mapper.selectCount(queryWrapper);
if (integer >= 10) { if (integer >= 10) {
......
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