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
6a2ced23
Commit
6a2ced23
authored
Sep 14, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店
parent
b0d91445
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
26 deletions
+5
-26
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+5
-26
No files found.
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
6a2ced23
...
...
@@ -632,44 +632,23 @@ public class StoreController extends DownloadUtils {
}
@RequestMapping
(
"transfer-store-member"
)
public
RestResponse
transferStoreMember
(
String
storeId
,
Integer
toStoreId
){
public
RestResponse
transferStoreMember
(
String
storeId
,
Integer
toStoreId
,
Integer
memberTransType
){
RedissonClient
redisClient
=
RedisUtil
.
getRedisClient
();
RMap
<
Integer
,
String
>
cacheMap
=
redisClient
.
getMap
(
"enterprise:store:transfermember:process"
);
String
cacheStoreId
=
cacheMap
.
get
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
StringUtils
.
isNotBlank
(
cacheStoreId
))
{
return
RestResponse
.
failure
(
ErrorCode
.
OPERATION_FAILED
.
getCode
(),
"请其他门店会员转移完毕后再试"
);
}
// 把参数改成storeInfoId
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
List
<
StoreDTO
>
storeInfoList
;
if
(
StringUtils
.
equals
(
storeId
,
Constants
.
ALL
))
{
storeInfoList
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
10000
,
"storeInfoId"
).
getResult
().
getResult
();
}
else
{
storeSearchDTO
.
setStoreIds
(
storeId
.
replace
(
','
,
' '
));
storeInfoList
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
storeId
.
split
(
" "
).
length
,
"storeInfoId"
).
getResult
().
getResult
();
}
List
<
String
>
list
=
storeInfoList
.
stream
().
map
(
e
->
e
.
getStoreInfoId
().
toString
()).
collect
(
Collectors
.
toList
());
Integer
storeInfoId
=
storeApiService
.
getStoreById
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
toStoreId
).
getResult
().
getStoreInfoId
();
StoreBatchUpdateDTO
storeBatchUpdateDTO
=
new
StoreBatchUpdateDTO
();
storeBatchUpdateDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
storeBatchUpdateDTO
.
setSourceStoreInfoIdList
(
list
);
storeBatchUpdateDTO
.
setTargetStoreInfoId
(
storeInfoId
+
""
);
storeBatchUpdateDTO
.
setUserId
(
UserDetailUtils
.
getUserDetail
().
getUserId
());
logger
.
info
(
"transfer-store-member:{}"
,
JSON
.
toJSONString
(
storeBatchUpdateDTO
));
ServiceResponse
<
Void
>
response
=
this
.
storeUpdateApiService
.
storeBatchUpdate
(
storeBatchUpdateDTO
);
logger
.
info
(
"transfer-store-member-result:{}"
,
JSON
.
toJSONString
(
response
));
tranMemberStore
(
storeId
,
toStoreId
,
memberTransType
);
cacheMap
.
put
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
storeId
);
for
(
String
store
:
list
)
{
String
[]
split
=
storeId
.
split
(
","
);
for
(
String
store
:
split
)
{
StoreDTO
storeDTO
=
storeApiService
.
getStoreById
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
Integer
.
valueOf
(
store
)).
getResult
();
if
(
storeDTO
!=
null
)
{
LogUtils
.
createLog
(
"会员处理"
,
storeDTO
.
getStoreName
());
}
}
return
EnterpriseRestResponse
.
failure
(
response
);
return
EnterpriseRestResponse
.
success
(
);
}
@RequestMapping
(
"process-store-member"
)
...
...
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