redis调用优化
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user