Commit 0b2b2d63 authored by liqin's avatar liqin 💬

bug fixed

parent f5c2d27d
...@@ -121,22 +121,22 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -121,22 +121,22 @@ public class ChinaMobileRestApiController extends BaseController {
final String organId = tBoxOperation.getOrganId(); final String organId = tBoxOperation.getOrganId();
final TUser tUser = getcurUser(); final TUser tUser = getcurUser();
if (tUser != null && organId.equals(tUser.getOrgId())) { if (tUser != null && organId.equals(tUser.getOrgId())) {
final String countStr = this.stringRedisTemplate.opsForValue().get(macAddress + "_count"); // final String countStr = this.stringRedisTemplate.opsForValue().get(macAddress + "_count");
if (StringUtils.isNotBlank(countStr)) { // if (StringUtils.isNotBlank(countStr)) {
final long count = Long.parseLong(countStr); // final long count = Long.parseLong(countStr);
if (count > 1) { // if (count > 1) {
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("key", ""); // jsonObject.put("key", "");
return getFailResult("400", "已经获取过一次,无法再次获取", jsonObject); // return getFailResult("400", "已经获取过一次,无法再次获取", jsonObject);
} // }
} else if (tBoxOperation.getRequestCount() > 1) { // } else if (tBoxOperation.getRequestCount() > 1) {
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("key", ""); // jsonObject.put("key", "");
return getFailResult("400", "已经获取过一次,无法再次获取", jsonObject); // return getFailResult("400", "已经获取过一次,无法再次获取", jsonObject);
} // }
this.stringRedisTemplate.opsForValue().increment(macAddress + "_count"); // this.stringRedisTemplate.opsForValue().increment(macAddress + "_count");
tBoxOperation.setRequestCount(tBoxOperation.getRequestCount() + 1); // tBoxOperation.setRequestCount(tBoxOperation.getRequestCount() + 1);
this.boxOperationService.updateById(tBoxOperation); // this.boxOperationService.updateById(tBoxOperation);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("key", tBoxOperation.getPrivateKey()); jsonObject.put("key", tBoxOperation.getPrivateKey());
......
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