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
24529580
Commit
24529580
authored
Jul 24, 2020
by
陶光胜
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
6b52c790
96070b5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+16
-4
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+9
-2
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
24529580
...
...
@@ -16,6 +16,7 @@ import com.gic.enterprise.response.EnterpriseServiceResponse;
import
com.gic.enterprise.service.CustomStoreApiService
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.enterprise.service.WmStoreSyncLogApiService
;
import
com.gic.enterprise.utils.LicenseUtils
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.search.business.api.constant.enums.OperateEnum
;
...
...
@@ -174,8 +175,14 @@ public class StoreApiServiceImpl implements StoreApiService {
if
(
storeDTO
.
getStoreId
()
==
null
)
{
ServiceResponse
<
List
<
EnterpriseLicenseDTO
>>
listEnterpriseLicense
=
this
.
enterpriseApiService
.
listEnterpriseLicense
(
storeDTO
.
getEnterpriseId
());
if
(
listEnterpriseLicense
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
listEnterpriseLicense
.
getResult
())){
if
(
listEnterpriseLicense
.
getResult
().
size
()==
4
){
storeDTO
.
setLicense
(
listEnterpriseLicense
.
getResult
().
get
(
3
).
getUpperLimit
());
boolean
hasStoreLicense
=
listEnterpriseLicense
.
getResult
()
.
stream
()
.
anyMatch
(
e
->
LicenseUtils
.
STORE_LICENSE_CODE
.
equals
(
e
.
getLicenseCode
()));
if
(
hasStoreLicense
){
Integer
storeLicenseNum
=
listEnterpriseLicense
.
getResult
().
stream
()
.
filter
(
e
->
LicenseUtils
.
STORE_LICENSE_CODE
.
equals
(
e
.
getLicenseCode
()))
.
collect
(
Collectors
.
toList
()).
get
(
0
).
getUpperLimit
();
storeDTO
.
setLicense
(
storeLicenseNum
);
}
}
Integer
id
=
storeService
.
save
(
storeDTO
);
...
...
@@ -270,9 +277,14 @@ public class StoreApiServiceImpl implements StoreApiService {
public
ServiceResponse
<
Void
>
tranOverFlow
(
Integer
enterpriseId
,
String
storeIds
)
{
ServiceResponse
<
List
<
EnterpriseLicenseDTO
>>
listEnterpriseLicense
=
this
.
enterpriseApiService
.
listEnterpriseLicense
(
enterpriseId
);
if
(
listEnterpriseLicense
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
listEnterpriseLicense
.
getResult
()))
{
if
(
listEnterpriseLicense
.
getResult
().
size
()
==
4
)
{
boolean
hasStoreLicense
=
listEnterpriseLicense
.
getResult
()
.
stream
()
.
anyMatch
(
e
->
LicenseUtils
.
STORE_LICENSE_CODE
.
equals
(
e
.
getLicenseCode
()));
if
(
hasStoreLicense
)
{
Integer
currCount
=
this
.
storeService
.
countByOverflowStatus
(
enterpriseId
,
0
);
Integer
upperLimit
=
listEnterpriseLicense
.
getResult
().
get
(
3
).
getUpperLimit
();
Integer
upperLimit
=
listEnterpriseLicense
.
getResult
().
stream
()
.
filter
(
e
->
LicenseUtils
.
STORE_LICENSE_CODE
.
equals
(
e
.
getLicenseCode
()))
.
collect
(
Collectors
.
toList
()).
get
(
0
).
getUpperLimit
();
// 剩余数量
int
remainingCount
=
upperLimit
-
currCount
;
if
(
storeIds
.
split
(
","
).
length
>
remainingCount
)
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
24529580
...
...
@@ -17,6 +17,7 @@ import com.gic.enterprise.response.EnterpriseRestResponse;
import
com.gic.enterprise.service.DownloadReportApiService
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.enterprise.service.QrCodeApiService
;
import
com.gic.enterprise.utils.LicenseUtils
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.log.api.service.LogApiService
;
...
...
@@ -283,9 +284,15 @@ public class StoreController extends DownloadUtils {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
List
<
EnterpriseLicenseDTO
>>
listEnterpriseLicense
=
this
.
enterpriseApiService
.
listEnterpriseLicense
(
enterpriseId
);
if
(
listEnterpriseLicense
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
listEnterpriseLicense
.
getResult
()))
{
if
(
listEnterpriseLicense
.
getResult
().
size
()
==
4
)
{
boolean
hasStoreLicense
=
listEnterpriseLicense
.
getResult
()
.
stream
()
.
anyMatch
(
e
->
LicenseUtils
.
STORE_LICENSE_CODE
.
equals
(
e
.
getLicenseCode
()));
if
(
hasStoreLicense
)
{
Integer
storeLicenseNum
=
listEnterpriseLicense
.
getResult
().
stream
()
.
filter
(
e
->
LicenseUtils
.
STORE_LICENSE_CODE
.
equals
(
e
.
getLicenseCode
()))
.
collect
(
Collectors
.
toList
()).
get
(
0
).
getUpperLimit
();
Integer
result
=
this
.
storeApiService
.
countByOverflowStatus
(
enterpriseId
).
getResult
();
return
RestResponse
.
success
(
listEnterpriseLicense
.
getResult
().
get
(
3
).
getUpperLimit
()
-
result
);
return
RestResponse
.
success
(
storeLicenseNum
-
result
);
}
}
return
RestResponse
.
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