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
4cad4707
Commit
4cad4707
authored
May 27, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购bug
parent
356e476a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
16 deletions
+34
-16
StoreTransferApiService.java
...n/java/com/gic/store/service/StoreTransferApiService.java
+12
-0
StoreTransferApiServiceImpl.java
...store/service/outer/impl/StoreTransferApiServiceImpl.java
+21
-0
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+1
-16
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreTransferApiService.java
View file @
4cad4707
...
...
@@ -17,4 +17,16 @@ public interface StoreTransferApiService {
* @throws
*/
ServiceResponse
<
Void
>
save
(
Integer
enterpriseId
,
Integer
fromStoreId
,
Integer
toStoreId
);
/**
* @Title: save
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeIds
* @param toStoreId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Void
>
save
(
Integer
enterpriseId
,
String
storeIds
,
Integer
toStoreId
);
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreTransferApiServiceImpl.java
View file @
4cad4707
...
...
@@ -8,9 +8,14 @@ import com.gic.store.dto.StoreTransferDTO;
import
com.gic.store.service.StoreService
;
import
com.gic.store.service.StoreTransferApiService
;
import
com.gic.store.service.StoreTransferService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* @author zhiwj
* @Description:
...
...
@@ -44,4 +49,20 @@ public class StoreTransferApiServiceImpl implements StoreTransferApiService {
return
EnterpriseServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
save
(
Integer
enterpriseId
,
String
storeIds
,
Integer
toStoreId
)
{
if
(
StringUtils
.
isNotBlank
(
storeIds
))
{
List
<
Integer
>
storeIdList
;
if
(
StringUtils
.
equals
(
storeIds
,
"all"
))
{
storeIdList
=
this
.
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
Stream
.
of
(
storeIds
.
split
(
","
)).
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
());
}
for
(
Integer
storeId
:
storeIdList
)
{
this
.
save
(
enterpriseId
,
storeId
,
toStoreId
);
}
}
return
ServiceResponse
.
success
();
}
}
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
4cad4707
...
...
@@ -356,22 +356,7 @@ public class StoreController extends DownloadUtils {
if
(
response
.
isSuccess
())
{
if
(
type
==
1
&&
toStoreId
!=
null
)
{
// 如果是批量修改状态 要转移门店
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
storeSearchDTO
.
setStoreIds
(
storeIds
.
replace
(
','
,
' '
));
Page
<
StoreDTO
>
page
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
1000
,
"storeInfoId"
).
getResult
();
if
(
page
==
null
||
page
.
getResult
()
==
null
)
{
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
List
<
String
>
list
=
page
.
getResult
().
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
));
this
.
storeUpdateApiService
.
storeBatchUpdate
(
storeBatchUpdateDTO
);
ServiceResponse
<
Void
>
serviceResponse
=
storeTransferApiService
.
save
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
storeIds
,
toStoreId
);
}
// 写日志
String
[]
storeArr
=
storeIds
.
split
(
","
);
...
...
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