Commit 9584d631 by lixian7

解绑接口bug修复

parent 0a94f7d1
......@@ -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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -56,6 +57,13 @@ public class H5Controller {
DefaultConverter defaultConverter;
/**
* 验证有效性限制时间
* 单位:小时
*/
@Value("${biz.check.validity.limit.time:24}")
Integer checkValidityLimitTime;
/**
* 年检信息查询接口
*
* @param query
......@@ -127,7 +135,7 @@ public class H5Controller {
public Response<CheckValidityRes> checkValidity(@RequestBody @Validated H5BindInfoQuery query) {
ParkVerifyInfo verifyInfo = verifyInfoMapper.checkValidity(query.getPhone(), query.getUserId(),
DateUtil.offsetDay(DateTime.now(), -1));
DateUtil.offsetHour(DateTime.now(), -checkValidityLimitTime));
CheckValidityRes checkValidityRes = new CheckValidityRes();
defaultConverter.getMapperFacade().map(query, checkValidityRes);
......
......@@ -77,7 +77,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
* 解除绑定时间限制
* 单位:小时
*/
@Value("${biz.unbind.time:-720}")
@Value("${biz.unbind.time:720}")
Integer unBindTime;
......@@ -161,7 +161,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
*/
QueryWrapper<ParkBindInfo> queryWrapper = new QueryWrapper<>();
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");
Integer integer = mapper.selectCount(queryWrapper);
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