Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
84682eef
Commit
84682eef
authored
May 31, 2021
by
季圣华
Browse files
redis调用优化
parent
416157d0
Changes
6
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
84682eef
...
...
@@ -325,7 +325,7 @@ public class DepotHeadController {
String
beanJson
=
body
.
getInfo
();
String
rows
=
body
.
getRows
();
Long
billsNumLimit
=
Long
.
parseLong
(
redisService
.
getObjectFromSessionByKey
(
request
,
"billsNumLimit"
).
toString
());
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
Long
count
=
depotHeadService
.
countDepotHead
(
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
);
if
(
count
>=
billsNumLimit
)
{
throw
new
BusinessParamCheckingException
(
ExceptionConstants
.
DEPOT_HEAD_OVER_LIMIT_FAILED_CODE
,
...
...
@@ -345,7 +345,7 @@ public class DepotHeadController {
*/
@PutMapping
(
value
=
"/updateDepotHeadAndDetail"
)
public
Object
updateDepotHeadAndDetail
(
@RequestBody
DepotHeadVo4Body
body
,
HttpServletRequest
request
)
throws
Exception
{
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
String
beanJson
=
body
.
getInfo
();
String
rows
=
body
.
getRows
();
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
84682eef
...
...
@@ -120,7 +120,7 @@ public class DepotItemController {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
BigDecimal
stock
=
BigDecimal
.
ZERO
;
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
List
<
MaterialVo4Unit
>
list
=
materialService
.
getMaterialByBarCode
(
barCode
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
MaterialVo4Unit
materialVo4Unit
=
list
.
get
(
0
);
...
...
@@ -154,7 +154,7 @@ public class DepotItemController {
@RequestParam
(
"mpList"
)
String
mpList
,
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
new
ArrayList
<
DepotItemVo4WithInfoEx
>();
if
(
headerId
!=
0
)
{
...
...
@@ -264,7 +264,7 @@ public class DepotItemController {
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
...
...
@@ -334,7 +334,7 @@ public class DepotItemController {
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"materialParam"
)
String
materialParam
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
...
...
@@ -384,7 +384,7 @@ public class DepotItemController {
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
materialParam
),
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
84682eef
...
...
@@ -166,7 +166,7 @@ public class MaterialController {
HttpServletRequest
request
)
throws
Exception
{
JSONObject
object
=
new
JSONObject
();
try
{
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
List
<
MaterialVo4Unit
>
dataList
=
materialService
.
findBySelectWithBarCode
(
categoryId
,
q
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
String
[]
mpArr
=
mpList
.
split
(
","
);
int
total
=
materialService
.
findBySelectWithBarCodeCount
(
categoryId
,
q
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java
View file @
84682eef
...
...
@@ -144,7 +144,9 @@ public class UserController {
data
.
put
(
"token"
,
token
);
data
.
put
(
"user"
,
user
);
//用户的按钮权限
data
.
put
(
"userBtn"
,
btnStrArr
);
if
(!
"admin"
.
equals
(
user
.
getLoginName
())){
data
.
put
(
"userBtn"
,
btnStrArr
);
}
data
.
put
(
"roleType"
,
roleType
);
}
res
.
code
=
200
;
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
84682eef
...
...
@@ -252,7 +252,7 @@ public class DepotHeadService {
//更新当前库存
List
<
DepotItem
>
list
=
depotItemService
.
getListByHeaderId
(
id
);
for
(
DepotItem
depotItem:
list
){
Long
tenantId
=
Long
.
parseLong
(
redisService
.
get
ObjectFromSessionByKey
(
request
,
"tenantId"
).
toString
()
);
Long
tenantId
=
redisService
.
get
TenantId
(
request
);
depotItemService
.
updateCurrentStock
(
depotItem
,
tenantId
);
}
}
catch
(
Exception
e
){
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/redis/RedisService.java
View file @
84682eef
...
...
@@ -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
;
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment