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
21b2dda7
Commit
21b2dda7
authored
Mar 26, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/base_platform_enterprise/gic-store
into developer
parents
52f8a8f8
1985ccb0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
48 deletions
+59
-48
StoreDictApiServiceImpl.java
...gic/store/service/outer/impl/StoreDictApiServiceImpl.java
+52
-42
ClerkController.java
...in/java/com/gic/store/web/controller/ClerkController.java
+3
-1
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+3
-1
StoreDictController.java
...ava/com/gic/store/web/controller/StoreDictController.java
+1
-4
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreDictApiServiceImpl.java
View file @
21b2dda7
...
...
@@ -179,53 +179,63 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
List
<
String
>
newList
=
Arrays
.
asList
(
values
.
split
(
","
));
List
<
String
>
add
=
newList
.
stream
().
filter
(
s
->
!
existList
.
contains
(
s
)).
collect
(
Collectors
.
toList
());
List
<
String
>
del
=
existList
.
stream
().
filter
(
s
->
!
newList
.
contains
(
s
)).
collect
(
Collectors
.
toList
());
add
.
forEach
(
s
->
{
TabStoreField
tabStoreField
=
this
.
storeFieldService
.
getStoreFieldById
(
Integer
.
valueOf
(
s
));
if
(
tabStoreField
.
getStoreFieldType
()
!=
null
&&
tabStoreField
.
getStoreFieldType
().
intValue
()
==
1
){
return
;
}
TabStoreDict
tabStoreDict
=
new
TabStoreDict
();
tabStoreDict
.
setEnterpriseId
(
enterpriseId
);
tabStoreDict
.
setCreateTime
(
new
Date
());
tabStoreDict
.
setValue
(
s
);
this
.
storeDictService
.
saveStoreField
(
tabStoreDict
);
String
key
=
StoreRedisKeyUtils
.
getStoreFieldKey
(
enterpriseId
,
Integer
.
valueOf
(
s
));
Object
existObj
=
RedisUtil
.
getCache
(
key
);
if
(
existObj
==
null
){
for
(
int
i
=
1
;
i
<=
10
;
i
++){
Object
obj
=
RedisUtil
.
getCache
(
keyc
+
"c"
+
i
);
if
(
obj
==
null
){
RedisUtil
.
setCache
(
keyc
+
"c"
+
i
,
s
);
RedisUtil
.
setCache
(
key
,
"c"
+
i
);
break
;
}
if
(
CollectionUtils
.
isNotEmpty
(
add
)){
add
.
forEach
(
s
->
{
if
(
StringUtils
.
isBlank
(
s
)){
return
;
}
}
});
del
.
forEach
(
s
->
{
String
key
=
StoreRedisKeyUtils
.
getStoreFieldKey
(
enterpriseId
,
Integer
.
valueOf
(
s
));
this
.
storeDictService
.
deleteStoreField
(
enterpriseId
,
s
);
Object
c
=
RedisUtil
.
getCache
(
key
);
String
storeListSourceKey
=
StoreRedisKeyUtils
.
getStoreListSourceKey
(
enterpriseId
,
userId
);
if
(
c
!=
null
){
RedisUtil
.
delCache
(
c
.
toString
());
//门店列表自定义字段配置,取消时需要删除当前已经配置的列表显示字段
Object
storeListSource
=
RedisUtil
.
getCache
(
storeListSourceKey
);
if
(
storeListSource
!=
null
){
String
[]
arr
=
storeListSource
.
toString
().
split
(
","
);
String
result
=
""
;
for
(
String
a
:
arr
){
if
(!
c
.
toString
().
equals
(
a
)){
result
+=
a
+
","
;
TabStoreField
tabStoreField
=
this
.
storeFieldService
.
getStoreFieldById
(
Integer
.
valueOf
(
s
));
if
(
tabStoreField
.
getStoreFieldType
()
!=
null
&&
tabStoreField
.
getStoreFieldType
().
intValue
()
==
1
){
return
;
}
TabStoreDict
tabStoreDict
=
new
TabStoreDict
();
tabStoreDict
.
setEnterpriseId
(
enterpriseId
);
tabStoreDict
.
setCreateTime
(
new
Date
());
tabStoreDict
.
setValue
(
s
);
this
.
storeDictService
.
saveStoreField
(
tabStoreDict
);
String
key
=
StoreRedisKeyUtils
.
getStoreFieldKey
(
enterpriseId
,
Integer
.
valueOf
(
s
));
Object
existObj
=
RedisUtil
.
getCache
(
key
);
if
(
existObj
==
null
){
for
(
int
i
=
1
;
i
<=
10
;
i
++){
Object
obj
=
RedisUtil
.
getCache
(
keyc
+
"c"
+
i
);
if
(
obj
==
null
){
RedisUtil
.
setCache
(
keyc
+
"c"
+
i
,
s
);
RedisUtil
.
setCache
(
key
,
"c"
+
i
);
break
;
}
}
if
(
StringUtils
.
isNotBlank
(
result
)){
RedisUtil
.
setCache
(
storeListSourceKey
,
result
);
}
});
}
if
(
CollectionUtils
.
isNotEmpty
(
del
)){
del
.
forEach
(
s
->
{
if
(
StringUtils
.
isBlank
(
s
)){
return
;
}
String
key
=
StoreRedisKeyUtils
.
getStoreFieldKey
(
enterpriseId
,
Integer
.
valueOf
(
s
));
this
.
storeDictService
.
deleteStoreField
(
enterpriseId
,
s
);
Object
c
=
RedisUtil
.
getCache
(
key
);
String
storeListSourceKey
=
StoreRedisKeyUtils
.
getStoreListSourceKey
(
enterpriseId
,
userId
);
if
(
c
!=
null
){
RedisUtil
.
delCache
(
c
.
toString
());
//门店列表自定义字段配置,取消时需要删除当前已经配置的列表显示字段
Object
storeListSource
=
RedisUtil
.
getCache
(
storeListSourceKey
);
if
(
storeListSource
!=
null
){
String
[]
arr
=
storeListSource
.
toString
().
split
(
","
);
String
result
=
""
;
for
(
String
a
:
arr
){
if
(!
c
.
toString
().
equals
(
a
)){
result
+=
a
+
","
;
}
}
if
(
StringUtils
.
isNotBlank
(
result
)){
RedisUtil
.
setCache
(
storeListSourceKey
,
result
);
}
}
}
}
RedisUtil
.
delCache
(
key
);
}
);
RedisUtil
.
delCache
(
key
);
}
);
}
return
ServiceResponse
.
success
();
}
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/ClerkController.java
View file @
21b2dda7
...
...
@@ -151,7 +151,7 @@ public class ClerkController extends DownloadUtils {
@RequestMapping
(
"clerk-qrcode-download"
)
public
RestResponse
clerkQrcodeDownload
(
@RequestBody
ClerkQrcodeQO
clerkQrcodeQO
){
int
total
=
clerkQrcodeQO
.
getContent
().
size
()
;
int
total
=
0
;
if
(
clerkQrcodeQO
.
getIsAll
()
==
1
){
ClerkSearchDTO
clerkSearchDTO
=
clerkQrcodeQO
.
getClerkSearchDTO
();
clerkSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
...
...
@@ -160,6 +160,8 @@ public class ClerkController extends DownloadUtils {
if
(
totalClerkServiceResponse
.
getResult
()
==
0
)
{
return
RestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
ErrorCode
.
NOTEXISTS
.
getMsg
());
}
}
else
{
total
=
clerkQrcodeQO
.
getContent
().
size
();
}
new
QrcodeDownload
(){
@Override
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
21b2dda7
...
...
@@ -350,7 +350,7 @@ public class StoreController extends DownloadUtils {
@RequestMapping
(
"store-qrcode-download"
)
public
RestResponse
storeQrcodeDownload
(
@RequestBody
QrcodeQO
qrcodeQO
){
int
total
=
qrcodeQO
.
getContent
().
size
()
;
int
total
=
0
;
if
(
qrcodeQO
.
getIsAll
()
==
1
){
StoreSearchDTO
storeSearchDTO
=
qrcodeQO
.
getStoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
...
...
@@ -359,6 +359,8 @@ public class StoreController extends DownloadUtils {
if
(
total
==
0
){
return
RestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"没有门店下载二维码"
);
}
}
else
{
total
=
qrcodeQO
.
getContent
().
size
();
}
new
QrcodeDownload
(){
@Override
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreDictController.java
View file @
21b2dda7
...
...
@@ -157,13 +157,10 @@ public class StoreDictController {
public
RestResponse
setStoreField
(
String
values
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
if
(
StringUtils
.
isBlank
(
values
)){
return
EnterpriseRestResponse
.
failure
(
com
.
gic
.
enterprise
.
error
.
ErrorCode
.
MISS_PARAMETER
);
}
String
key
=
"relevanceStorefield:"
+
enterpriseId
;
Object
cache
=
RedisUtil
.
getCache
(
key
);
if
(
cache
!=
null
){
return
RestResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
"请稍后重试"
);
//
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "请稍后重试");
}
AuditLogDTO
auditLogDTO
=
new
AuditLogDTO
();
auditLogDTO
.
setEnterpriseId
(
1129
);
...
...
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