|
|
@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.nl.common.base.CommonPage; |
|
|
|
import org.nl.common.enums.wms.EasBillTypeEnum; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.common.utils.RedisUtils; |
|
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
|
import org.nl.config.IdUtil; |
|
|
|
import org.nl.wms.database.eas.dao.*; |
|
|
@ -30,6 +31,7 @@ import org.nl.wms.ext.srm.WmsToSrmService; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -45,6 +47,7 @@ import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -83,10 +86,28 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
@Qualifier("threadPoolExecutor") |
|
|
|
private ThreadPoolExecutor pool; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<HomeBillCounts> getBillsCount() { |
|
|
|
String cacheKey = "billCounts"; |
|
|
|
//从Redis中获取缓存数据
|
|
|
|
List<HomeBillCounts> cachedCounts = (List<HomeBillCounts>) redisUtils.get(cacheKey); |
|
|
|
if (cachedCounts != null) { |
|
|
|
return cachedCounts; |
|
|
|
} |
|
|
|
List<HomeBillCounts> allCounts = queryBillsCount(); |
|
|
|
// 将结果存入Redis,设置过期时间为1小时
|
|
|
|
redisUtils.set(cacheKey, allCounts, 1, TimeUnit.HOURS); |
|
|
|
return allCounts; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 首页显示出入库单据数量 |
|
|
|
*/ |
|
|
|
public List<HomeBillCounts> getBillsCount() { |
|
|
|
public List<HomeBillCounts> queryBillsCount() { |
|
|
|
AtomicReference<Long> receiptCount = new AtomicReference<>(0L); |
|
|
|
AtomicReference<Long> allocationCount = new AtomicReference<>(0L); |
|
|
|
AtomicReference<List<HomeBillCounts>> inOutBillList = new AtomicReference<>(); |
|
|
|