Commit d2a24d54 by bilingfeng

feat : 新增一个测试使用删除缓存接口

parent 5488be04
...@@ -401,13 +401,40 @@ public class ClerkController extends WebBaseController{ ...@@ -401,13 +401,40 @@ public class ClerkController extends WebBaseController{
audit.setCommitTime(new Date()); audit.setCommitTime(new Date());
audit.setAuditType(AuditType.CLERK_DEL.getCode()); audit.setAuditType(AuditType.CLERK_DEL.getCode());
auditApiService.insert(audit); auditApiService.insert(audit);
syncHaobanToGicServiceApi.delGicClerk(clerkId); syncHaobanToGicServiceApi.delGicClerk(clerkId);
} }
} }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
/**
* 删除设置主门店和刷新微信好友的缓存限制
*
* @param staffId : 关联标识
* @param dateTime : 时间, 13位时间戳
* @param type : 类型, 1 : 主门店, 2 : 刷新微信好友
*/
@RequestMapping("/delCache")
public void deleteCache(String staffId, Long dateTime, Integer type) {
if (StringUtils.isBlank(staffId) || dateTime == null || type == null) {
return;
}
String yyyyMM = DateUtil.dateToStr(new Date(dateTime), "yyyyMM");
String key = null;
//设置主门店缓存
if (Objects.equals(type, 1)) {
key = "haoban_set_main_store_" + yyyyMM + staffId;
}
if (Objects.equals(type, 2)) {
key = "haoban_fresh_wx_friend" + yyyyMM + staffId;
}
if (StringUtils.isBlank(key)) {
return;
}
RedisUtil.delCache(key);
}
//设置主导购 //设置主导购
...@@ -445,8 +472,6 @@ public class ClerkController extends WebBaseController{ ...@@ -445,8 +472,6 @@ public class ClerkController extends WebBaseController{
logger.info("次数超出限制:{}", staffId); logger.info("次数超出限制:{}", staffId);
return resultResponse(HaoBanErrCode.ERR_10011); return resultResponse(HaoBanErrCode.ERR_10011);
} }
RedisUtil.setCache(key, count + 1, 31 * 24 * 60 * 60L);
if (flushType == 0) { if (flushType == 0) {
String taskName = "刷新企业微信好友("+staff.getStaffName()+")"; String taskName = "刷新企业微信好友("+staff.getStaffName()+")";
String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(wxEnterpriseId, taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType()); String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(wxEnterpriseId, taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType());
...@@ -464,6 +489,7 @@ public class ClerkController extends WebBaseController{ ...@@ -464,6 +489,7 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_10022); return resultResponse(HaoBanErrCode.ERR_10022);
} }
} }
RedisUtil.setCache(key, count + 1, 31 * 24 * 60 * 60L);
//刷新状态变更 //刷新状态变更
clerkMainStoreRelatedApiService.setFreshFriend(wxEnterpriseId, staffId); clerkMainStoreRelatedApiService.setFreshFriend(wxEnterpriseId, staffId);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
......
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