Commit 1bf944e9 by 墨竹

fix:加锁

parent b334ed76
...@@ -209,6 +209,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -209,6 +209,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger.error("未查询到微信企业"); logger.error("未查询到微信企业");
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "微信企业不存在"); return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "微信企业不存在");
} }
String lockKey = "qrCodeAdd"+wxEnterpriseId;
if (RedisUtil.isLocked(lockKey)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_13.getCode()), "正在批量创建活码,请稍后再试");
}
RedisUtil.lock(lockKey,10L);
String enterpriseId = hmQrcodeQDTO.getEnterpriseId(); String enterpriseId = hmQrcodeQDTO.getEnterpriseId();
List<String> clerkIdList = hmQrcodeQDTO.getClerkIdList(); List<String> clerkIdList = hmQrcodeQDTO.getClerkIdList();
if (CollectionUtils.isEmpty(clerkIdList)) { if (CollectionUtils.isEmpty(clerkIdList)) {
......
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