Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-store
Commits
6241141d
Commit
6241141d
authored
Jul 08, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义字段写入redis
parent
b8b43692
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
StoreDictApiServiceImpl.java
.../com/gic/store/service/outer/StoreDictApiServiceImpl.java
+19
-0
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/StoreDictApiServiceImpl.java
View file @
6241141d
...
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.bizdict.api.dto.BizdictDTO
;
import
com.gic.bizdict.api.service.BizdictService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.dto.StoreDictDTO
;
import
com.gic.store.entity.TabStoreDict
;
import
com.gic.store.entity.TabStoreField
;
...
...
@@ -120,6 +121,8 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
@Override
public
ServiceResponse
saveStoreField
(
Integer
enterpriseId
,
String
value
,
int
type
)
{
String
key
=
"enterprise:store:storeField:"
+
enterpriseId
+
":"
+
value
;
String
keyc
=
"enterprise:store:storeField:"
+
enterpriseId
+
":c"
;
if
(
type
==
1
){
//新增
List
<
String
>
list
=
this
.
storeDictService
.
listStoreField
(
enterpriseId
);
for
(
String
s
:
list
){
...
...
@@ -132,8 +135,24 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
tabStoreDict
.
setCreateTime
(
new
Date
());
tabStoreDict
.
setValue
(
value
);
this
.
storeDictService
.
saveStoreField
(
tabStoreDict
);
Object
existObj
=
RedisUtil
.
getCache
(
key
);
if
(
existObj
!=
null
){
for
(
int
i
=
1
;
i
<=
10
;
i
++){
Object
obj
=
RedisUtil
.
getCache
(
keyc
+
i
);
if
(
obj
==
null
){
RedisUtil
.
setCache
(
keyc
+
i
,
value
);
RedisUtil
.
setCache
(
key
,
keyc
+
i
);
}
}
}
}
else
{
this
.
storeDictService
.
deleteStoreField
(
enterpriseId
,
value
);
Object
c
=
RedisUtil
.
getCache
(
key
);
if
(
c
!=
null
){
RedisUtil
.
delCache
(
c
.
toString
());
}
RedisUtil
.
delCache
(
key
);
}
return
ServiceResponse
.
success
();
}
...
...
Write
Preview
Markdown
is supported
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