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
32ded434
Commit
32ded434
authored
Jun 24, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!20
parents
d86b52a2
69083e50
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
16 deletions
+57
-16
StoreSearchDTO.java
...e-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
+10
-0
WxSearchStoreSearchDTO.java
...c/main/java/com/gic/store/dto/WxSearchStoreSearchDTO.java
+10
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+34
-16
TabStoreMapper.xml
...tore-service/src/main/resources/mapper/TabStoreMapper.xml
+3
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
View file @
32ded434
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
StoreSearchDTO
implements
Serializable
{
private
Integer
storeGroupId
;
...
...
@@ -26,6 +27,7 @@ public class StoreSearchDTO implements Serializable {
private
Integer
pageSize
=
20
;
private
Integer
storeTagId
;
private
Integer
completeStatus
;
private
List
<
Integer
>
storeResourceList
;
public
Integer
getStoreGroupId
()
{
return
storeGroupId
;
...
...
@@ -212,4 +214,12 @@ public class StoreSearchDTO implements Serializable {
this
.
completeStatus
=
completeStatus
;
return
this
;
}
public
List
<
Integer
>
getStoreResourceList
()
{
return
storeResourceList
;
}
public
void
setStoreResourceList
(
List
<
Integer
>
storeResourceList
)
{
this
.
storeResourceList
=
storeResourceList
;
}
}
gic-store-api/src/main/java/com/gic/store/dto/WxSearchStoreSearchDTO.java
View file @
32ded434
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
WxSearchStoreSearchDTO
implements
Serializable
{
private
Integer
enterpriseId
;
...
...
@@ -10,6 +11,7 @@ public class WxSearchStoreSearchDTO implements Serializable {
private
Integer
brandId
;
private
String
appid
;
private
Integer
StoreWidgetId
;
private
List
<
Integer
>
storeWidgetIdList
;
private
Integer
pageNum
=
1
;
private
Integer
pageSize
=
20
;
...
...
@@ -84,4 +86,12 @@ public class WxSearchStoreSearchDTO implements Serializable {
public
void
setStoreWidgetId
(
Integer
storeWidgetId
)
{
StoreWidgetId
=
storeWidgetId
;
}
public
List
<
Integer
>
getStoreWidgetIdList
()
{
return
storeWidgetIdList
;
}
public
void
setStoreWidgetIdList
(
List
<
Integer
>
storeWidgetIdList
)
{
this
.
storeWidgetIdList
=
storeWidgetIdList
;
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
32ded434
...
...
@@ -784,6 +784,7 @@ public class StoreApiServiceImpl implements StoreApiService {
storeSearchDTO
.
setLongitude
(
wxSearchStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
wxSearchStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
wxSearchStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setStoreResourceList
(
wxSearchStoreSearchDTO
.
getStoreWidgetIdList
());
ServiceResponse
<
Page
<
StoreDTO
>>
storePage
=
this
.
listStore
(
storeSearchDTO
,
wxSearchStoreSearchDTO
.
getPageNum
(),
wxSearchStoreSearchDTO
.
getPageSize
());
logger
.
info
(
"pageCoupApplyStore:{}"
,
JSON
.
toJSONString
(
storePage
,
true
));
return
ServiceResponse
.
success
(
storePage
.
getResult
());
...
...
@@ -1513,8 +1514,37 @@ public class StoreApiServiceImpl implements StoreApiService {
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
LOCATION
.
getField
(),
OperateEnum
.
OPERATE_LOCATION
,
storeSearchDTO
.
getLatitude
()+
","
+
storeSearchDTO
.
getLongitude
());
jsonObjectList
.
add
(
json
);
}
if
(
storeSearchDTO
.
getStoreResource
()
!=
null
){
StoreWidgetDTO
storeWidget
=
this
.
storeWidgetService
.
getStoreWidget
(
storeSearchDTO
.
getStoreResource
().
intValue
());
String
storeWidgetJSON
=
this
.
buildStoreWidgetJSON
(
storeSearchDTO
.
getStoreResource
()
==
null
?
null
:
storeSearchDTO
.
getStoreResource
().
intValue
(),
json
,
jsonObjectList
);
/*****如果存在没有门店权限的门店控件id,直接返回*****/
if
(
StringUtils
.
isNotBlank
(
storeWidgetJSON
))
{
return
null
;
}
if
(
CollectionUtils
.
isNotEmpty
(
storeSearchDTO
.
getStoreResourceList
())){
for
(
Integer
storeResource
:
storeSearchDTO
.
getStoreResourceList
()){
String
s
=
this
.
buildStoreWidgetJSON
(
storeResource
,
json
,
jsonObjectList
);
if
(
StringUtils
.
isNotBlank
(
s
)){
return
null
;
}
}
}
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonObjectList
,
OperateEnum
.
OPERATE_AND
);
/***build notIn search****/
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreIdsOfNot
())){
List
<
JSONObject
>
list
=
new
ArrayList
<>();
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STOREID
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreIdsOfNot
());
list
.
add
(
json
);
JSONObject
notJSON
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
list
,
OperateEnum
.
OPERATE_AND_NOT
);
List
<
JSONObject
>
_list
=
new
ArrayList
<>();
_list
.
add
(
enterpriseJson
);
_list
.
add
(
notJSON
);
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
_list
,
OperateEnum
.
OPERATE_AND
);
}
return
enterpriseJson
;
}
private
String
buildStoreWidgetJSON
(
Integer
storeWidgetId
,
JSONObject
json
,
List
<
JSONObject
>
jsonObjectList
){
if
(
storeWidgetId
!=
null
){
StoreWidgetDTO
storeWidget
=
this
.
storeWidgetService
.
getStoreWidget
(
storeWidgetId
.
intValue
());
if
(
storeWidget
!=
null
){
if
(
storeWidget
.
getAuthMode
()
!=
null
&&
storeWidget
.
getAuthMode
()
==
1
&&
StringUtils
.
isNotBlank
(
storeWidget
.
getSearchParam
())
&&
!
"{}"
.
equals
(
storeWidget
.
getSearchParam
())){
...
...
@@ -1533,23 +1563,11 @@ public class StoreApiServiceImpl implements StoreApiService {
}
}
if
(
storeWidget
.
getAuthMode
()
!=
null
&&
storeWidget
.
getAuthMode
()
==
2
){
return
null
;
return
"noAuth"
;
}
}
}
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonObjectList
,
OperateEnum
.
OPERATE_AND
);
/***build notIn search****/
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreIdsOfNot
())){
List
<
JSONObject
>
list
=
new
ArrayList
<>();
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STOREID
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreIdsOfNot
());
list
.
add
(
json
);
JSONObject
notJSON
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
list
,
OperateEnum
.
OPERATE_AND_NOT
);
List
<
JSONObject
>
_list
=
new
ArrayList
<>();
_list
.
add
(
enterpriseJson
);
_list
.
add
(
notJSON
);
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
_list
,
OperateEnum
.
OPERATE_AND
);
}
return
enterpriseJson
;
return
null
;
}
private
static
ServiceResponse
<
String
>
responseErrorElement
(
ImportStoreBatchResultEnum
error
)
{
...
...
gic-store-service/src/main/resources/mapper/TabStoreMapper.xml
View file @
32ded434
...
...
@@ -40,6 +40,9 @@
#{updateTime,jdbcType=TIMESTAMP}, #{score,jdbcType=DOUBLE}, #{evaluateCount,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.store.entity.TabStore"
>
<selectKey
keyProperty=
"storeId"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_store
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeId != null"
>
...
...
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