|
|
|
@ -254,13 +254,13 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
|
|
|
|
|
public FactoryAuthVO findFactoryAuth(String companyCode) { |
|
|
|
|
// redis 缓存数据 缓存时间 1天
|
|
|
|
|
if (StrUtil.isNotBlank(companyCode)) { |
|
|
|
|
String key = StrUtil.format("factory-data:suofeiya:", companyCode); |
|
|
|
|
String key = "factory-data:suofeiya:" + companyCode; |
|
|
|
|
String json = bladeRedis.get(key); |
|
|
|
|
if (StrUtil.isNotBlank(json)) { |
|
|
|
|
return JSONUtil.toBean(json, FactoryAuthVO.class); |
|
|
|
|
} else { |
|
|
|
|
List<FactoryAuthVO> factoryAuth = baseMapper.findFactoryAuth(companyCode); |
|
|
|
|
if(CollUtil.isNotEmpty(factoryAuth)){ |
|
|
|
|
if (CollUtil.isNotEmpty(factoryAuth)) { |
|
|
|
|
FactoryAuthVO authVO = factoryAuth.get(0); |
|
|
|
|
bladeRedis.setEx(key, JSONUtil.toJsonStr(authVO), Duration.ofDays(1)); |
|
|
|
|
return authVO; |
|
|
|
@ -274,7 +274,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
|
|
|
|
|
public FactoryAuthVO findFactoryAuthByTenantCode(String tenantId) { |
|
|
|
|
// redis 缓存数据 缓存时间 1天
|
|
|
|
|
if (StrUtil.isNotBlank(tenantId)) { |
|
|
|
|
String key = StrUtil.format("factory-data:suofeiya:tenant-code:", tenantId); |
|
|
|
|
String key = "factory-data:suofeiya:tenant-code:" + tenantId; |
|
|
|
|
String json = bladeRedis.get(key); |
|
|
|
|
if (StrUtil.isNotBlank(json)) { |
|
|
|
|
return JSONUtil.toBean(json, FactoryAuthVO.class); |
|
|
|
|