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
7de183c1
Commit
7de183c1
authored
Sep 08, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店转移会员
parent
3bbf353a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletions
+33
-1
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+31
-1
dubbo-gic-store-web.xml
gic-store-web/src/main/resources/dubbo-gic-store-web.xml
+2
-0
No files found.
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
7de183c1
...
...
@@ -26,6 +26,7 @@ import com.gic.member.api.dto.BatchTaskOperaInfDTO;
import
com.gic.member.api.dto.StoreBatchUpdateDTO
;
import
com.gic.member.api.service.BatchOperationApiService
;
import
com.gic.member.api.service.StoreUpdateApiService
;
import
com.gic.member.api.service.UserOwnerApiService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.constant.*
;
import
com.gic.store.dto.*
;
...
...
@@ -105,6 +106,8 @@ public class StoreController extends DownloadUtils {
private
StoreTransferApiService
storeTransferApiService
;
@Autowired
private
BatchOperationApiService
batchOperationApiService
;
@Autowired
private
UserOwnerApiService
userOwnerApiService
;
private
Map
<
Integer
,
SimpleDateFormat
>
map
=
new
ConcurrentHashMap
<>();
...
...
@@ -373,16 +376,26 @@ public class StoreController extends DownloadUtils {
}
@RequestMapping
(
"bulk-update-store"
)
public
RestResponse
bulkUpdateStatus
(
String
storeIds
,
String
value
,
int
type
,
Integer
toStoreId
)
{
public
RestResponse
bulkUpdateStatus
(
String
storeIds
,
String
value
,
int
type
,
Integer
toStoreId
,
Integer
memberTransType
,
Integer
memberTransStoreId
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
if
(
StringUtils
.
isBlank
(
storeIds
)
||
StringUtils
.
isBlank
(
value
))
{
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
MISS_PARAMETER
);
}
if
(
type
==
1
&&
memberTransStoreId
!=
null
)
{
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
(),
"请其他门店会员转移完毕后再试"
);
}
}
ServiceResponse
response
=
this
.
storeApiService
.
bulkUpdateStore
(
storeIds
,
value
,
enterpriseId
,
type
,
UserDetailUtils
.
getUserDetail
().
getUserId
(),
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getUserName
());
if
(
response
.
isSuccess
())
{
if
(
type
==
1
&&
toStoreId
!=
null
)
{
// 如果是批量修改状态 要转移门店
ServiceResponse
<
Void
>
serviceResponse
=
storeTransferApiService
.
save
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
storeIds
,
toStoreId
);
tranMemberStore
(
storeIds
,
memberTransStoreId
,
memberTransType
);
}
// 写日志
String
[]
storeArr
=
storeIds
.
split
(
","
);
...
...
@@ -413,6 +426,23 @@ public class StoreController extends DownloadUtils {
return
EnterpriseRestResponse
.
failure
(
response
);
}
private
void
tranMemberStore
(
String
storeIds
,
Integer
memberTransStoreId
,
Integer
memberTransType
)
{
if
(
memberTransStoreId
!=
null
&&
memberTransType
!=
null
)
{
List
<
StoreDTO
>
storeInfoList
;
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
StringUtils
.
equals
(
storeIds
,
"all"
))
{
storeInfoList
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
10000
,
"storeInfoId"
).
getResult
().
getResult
();
}
else
{
storeSearchDTO
.
setStoreIds
(
storeIds
.
replace
(
','
,
' '
));
storeInfoList
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
storeIds
.
split
(
" "
).
length
,
"storeInfoId"
).
getResult
().
getResult
();
}
Integer
storeInfoId
=
storeApiService
.
getStoreById
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
memberTransStoreId
).
getResult
().
getStoreInfoId
();
List
<
Integer
>
storeInfoIdList
=
storeInfoList
.
stream
().
map
(
StoreInfoDTO:
:
getStoreInfoId
).
collect
(
Collectors
.
toList
());
userOwnerApiService
.
transferStore
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
storeInfoIdList
,
storeInfoId
,
memberTransType
);
}
}
@RequestMapping
(
"list-store-export-field"
)
public
RestResponse
listStoreExportField
(){
List
<
StoreListSourceVO
>
listSource
=
this
.
getStoreAllListSource
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
...
...
gic-store-web/src/main/resources/dubbo-gic-store-web.xml
View file @
7de183c1
...
...
@@ -64,5 +64,6 @@
<dubbo:reference
interface=
"com.gic.enterprise.service.EnterpriseApiService"
id=
"enterpriseApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.store.service.DictApiService"
id=
"dictApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.BatchOperationApiService"
id=
"batchOperationApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.UserOwnerApiService"
id=
"userOwnerApiService"
timeout=
"6000"
/>
</beans>
\ No newline at end of file
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