redis调用优化

This commit is contained in:
季圣华
2021-05-31 23:38:51 +08:00
parent 416157d020
commit 84682eef9f
6 changed files with 20 additions and 10 deletions

View File

@@ -252,7 +252,7 @@ public class DepotHeadService {
//更新当前库存
List<DepotItem> list = depotItemService.getListByHeaderId(id);
for(DepotItem depotItem: list){
Long tenantId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"tenantId").toString());
Long tenantId = redisService.getTenantId(request);
depotItemService.updateCurrentStock(depotItem,tenantId);
}
}catch(Exception e){

View File

@@ -95,4 +95,12 @@ public class RedisService {
}
}
}
public Long getTenantId(HttpServletRequest request) {
if(getObjectFromSessionByKey(request,"tenantId")!=null) {
return Long.parseLong(getObjectFromSessionByKey(request, "tenantId").toString());
} else {
return null;
}
}
}