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
454ec291
Commit
454ec291
authored
Jul 24, 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
9b98e136
24529580
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
6 deletions
+113
-6
StoreSearchDTO.java
...e-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
+54
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+50
-4
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+9
-2
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
View file @
454ec291
...
...
@@ -29,6 +29,12 @@ public class StoreSearchDTO implements Serializable {
private
Integer
completeStatus
;
private
List
<
Integer
>
storeResourceList
;
private
Integer
erpStatus
;
private
String
storeGroupIds
;
private
String
regionIds
;
private
String
storeTypes
;
private
String
storeStatuss
;
private
String
erpStatuss
;
private
String
storeTags
;
public
Integer
getStoreGroupId
()
{
return
storeGroupId
;
...
...
@@ -232,4 +238,52 @@ public class StoreSearchDTO implements Serializable {
this
.
erpStatus
=
erpStatus
;
return
this
;
}
public
String
getStoreGroupIds
()
{
return
storeGroupIds
;
}
public
void
setStoreGroupIds
(
String
storeGroupIds
)
{
this
.
storeGroupIds
=
storeGroupIds
;
}
public
String
getRegionIds
()
{
return
regionIds
;
}
public
void
setRegionIds
(
String
regionIds
)
{
this
.
regionIds
=
regionIds
;
}
public
String
getStoreTypes
()
{
return
storeTypes
;
}
public
void
setStoreTypes
(
String
storeTypes
)
{
this
.
storeTypes
=
storeTypes
;
}
public
String
getStoreStatuss
()
{
return
storeStatuss
;
}
public
void
setStoreStatuss
(
String
storeStatuss
)
{
this
.
storeStatuss
=
storeStatuss
;
}
public
String
getErpStatuss
()
{
return
erpStatuss
;
}
public
void
setErpStatuss
(
String
erpStatuss
)
{
this
.
erpStatuss
=
erpStatuss
;
}
public
String
getStoreTags
()
{
return
storeTags
;
}
public
void
setStoreTags
(
String
storeTags
)
{
this
.
storeTags
=
storeTags
;
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
454ec291
...
...
@@ -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
)
{
...
...
@@ -779,6 +791,7 @@ public class StoreApiServiceImpl implements StoreApiService {
storeSearchDTO
.
setLongitude
(
coupApplyStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
coupApplyStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
coupApplyStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setStoreResourceList
(
coupApplyStoreSearchDTO
.
getStoreWidgetIdList
());
if
(
coupApplyStoreSearchDTO
.
getStoreWidgetId
()
!=
null
){
storeSearchDTO
.
setStoreResource
(
Long
.
valueOf
(
storeWidgetId
+
""
));
}
...
...
@@ -1531,6 +1544,39 @@ public class StoreApiServiceImpl implements StoreApiService {
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
LOCATION
.
getField
(),
OperateEnum
.
OPERATE_LOCATION
,
storeSearchDTO
.
getLatitude
()+
","
+
storeSearchDTO
.
getLongitude
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreGroupIds
())){
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STOREGROUPIDLIST
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreGroupIds
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getRegionIds
())){
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
REGIONID
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getRegionIds
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreTypes
())){
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STORETYPE
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreTypes
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreStatuss
())){
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STATUS
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreStatuss
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getErpStatuss
())){
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
ERPSTATUS
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getErpStatuss
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreTags
())){
String
[]
arr
=
storeSearchDTO
.
getStoreTags
().
split
(
","
);
List
<
TabStoreTag
>
storeTags
=
this
.
storeTagService
.
listByEnterprise
(
storeSearchDTO
.
getEnterpriseId
());
storeTags
.
stream
().
filter
(
tag
->
{
for
(
String
s
:
arr
)
{
if
(
tag
.
getStoreTagId
().
intValue
()
==
Integer
.
valueOf
(
s
))
{
return
true
;
}
}
return
false
;
}).
map
(
tag
->
storeSearchDTO
.
getStoreResourceList
().
add
(
tag
.
getStoreTagId
()));
}
String
storeWidgetJSON
=
this
.
buildStoreWidgetJSON
(
storeSearchDTO
.
getStoreResource
()
==
null
?
null
:
storeSearchDTO
.
getStoreResource
().
intValue
(),
json
,
jsonObjectList
);
/*****如果存在没有门店权限的门店控件id,直接返回*****/
if
(
StringUtils
.
isNotBlank
(
storeWidgetJSON
))
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
454ec291
...
...
@@ -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