Commit 0b2b2d63 authored by liqin's avatar liqin 💬

bug fixed

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