Commit 02569828 authored by zhangfeng's avatar zhangfeng

feat(wealth): 财务报表

parent 58c0ebfc
......@@ -26,13 +26,17 @@ public class BoxReportCacheLoader implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("初始化应收报表缓存");
List<Long> boxIds = receivableMapper.getAllBoxId();
Set<String> keys = redisHelper.keys(BOX_AMOUNT_CACHE + "*");
if (CollectionUtil.isNotEmpty(keys)) {
List<Long> cacheBoxIds = keys.stream().map(key -> Long.parseLong(key.replace(BOX_AMOUNT_CACHE, ""))).collect(Collectors.toList());
boxIds = boxIds.stream().filter(boxId -> !cacheBoxIds.contains(boxId)).collect(Collectors.toList());
try {
List<Long> boxIds = receivableMapper.getAllBoxId();
Set<String> keys = redisHelper.keys(BOX_AMOUNT_CACHE + "*");
if (CollectionUtil.isNotEmpty(keys)) {
List<Long> cacheBoxIds = keys.stream().map(key -> Long.parseLong(key.replace(BOX_AMOUNT_CACHE, ""))).collect(Collectors.toList());
boxIds = boxIds.stream().filter(boxId -> !cacheBoxIds.contains(boxId)).collect(Collectors.toList());
}
receivableService.updateBoxAmountCache(boxIds, false);
} catch (Exception e) {
log.error("初始化应收报表缓存失败", e);
}
receivableService.updateBoxAmountCache(boxIds, false);
log.info("初始化应收报表缓存完成");
}
}
......@@ -112,7 +112,8 @@
FROM ecw_receivable_write_off_record erwor
LEFT JOIN ecw_receipt_item eri ON erwor.receipt_item_id = eri.id
WHERE
erwor.order_id IN
erwor.income_belong IS NOT NULL
AND erwor.order_id IN
<foreach collection="orderIds" item="orderId" open="(" separator="," close=")">
#{orderId}
</foreach>
......
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