master:APP档口访问量BUG修复;

pull/1121/head
liujiang 2025-12-03 16:31:00 +08:00
parent 571bc49201
commit c5943572bf
2 changed files with 8 additions and 2 deletions

View File

@ -157,6 +157,12 @@ public class DailyTaskController extends BaseController {
return R.ok();
}
@PostMapping("/store-visit")
public R updateStoreVisitCount(SysJob sysJob) {
task.updateStoreVisitCount();
return R.ok();
}
}

View File

@ -888,7 +888,7 @@ public class XktTask {
@Transactional
public void updateStoreVisitCount() {
// 档口访问量
Map<String, Long> storeVisitMap = redisCache.getCacheMap(CacheConstants.STORE_VISIT_COUNT);
Map<String, Integer> storeVisitMap = redisCache.getCacheMap(CacheConstants.STORE_VISIT_COUNT);
if (MapUtil.isEmpty(storeVisitMap)) {
return;
}
@ -898,7 +898,7 @@ public class XktTask {
return;
}
storeList.forEach(store -> {
Long viewCount = storeVisitMap.getOrDefault(store.getId().toString(), 0L);
Integer viewCount = storeVisitMap.getOrDefault(store.getId().toString(), 0);
Long existViewCount = ObjectUtils.defaultIfNull(store.getViewCount(), 0L);
store.setViewCount(existViewCount + viewCount);
// 清除当日缓存