Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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-webapp-plug
Commits
47326ba1
Commit
47326ba1
authored
Apr 09, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店标签回写
parent
4ea6e714
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
41 deletions
+131
-41
ScreeningController.java
...java/com/gic/plug/web/controller/ScreeningController.java
+2
-40
StoreController.java
...ain/java/com/gic/plug/web/controller/StoreController.java
+52
-1
StoreWidgetVO.java
src/main/java/com/gic/plug/web/vo/StoreWidgetVO.java
+77
-0
No files found.
src/main/java/com/gic/plug/web/controller/ScreeningController.java
View file @
47326ba1
...
@@ -132,11 +132,7 @@ public class ScreeningController {
...
@@ -132,11 +132,7 @@ public class ScreeningController {
return
RestResponse
.
success
(
dto
);
return
RestResponse
.
success
(
dto
);
}
}
@RequestMapping
(
"screen-back"
)
@ResponseBody
public
Object
screenBack
(
String
param
)
throws
ClassNotFoundException
{
return
RestResponse
.
success
(
this
.
getScreenBack
(
param
));
}
@RequestMapping
(
"get-user-store-resource"
)
@RequestMapping
(
"get-user-store-resource"
)
@ResponseBody
@ResponseBody
...
@@ -160,39 +156,5 @@ public class ScreeningController {
...
@@ -160,39 +156,5 @@ public class ScreeningController {
return
RestResponse
.
success
(
new
StoreResourceVO
());
return
RestResponse
.
success
(
new
StoreResourceVO
());
}
}
private
String
getScreenBack
(
String
param
)
throws
ClassNotFoundException
{
if
(
StringUtils
.
isBlank
(
param
)){
return
""
;
}
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
JSONArray
array
=
JSON
.
parseArray
(
param
);
StringBuilder
backMessage
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
array
.
size
();
i
++){
JSONObject
jsonObject
=
array
.
getJSONObject
(
i
);
String
type
=
jsonObject
.
getString
(
"type"
);
if
(
StringUtils
.
isNotBlank
(
type
)){
if
(
OperateEnum
.
OPERATE_AND_NOT
.
getValue
().
equals
(
type
)){
backMessage
.
append
(
OperateEnum
.
OPERATE_AND_NOT
.
getDescribe
()).
append
(
" "
);
}
if
(
OperateEnum
.
OPERATE_OR
.
getValue
().
equals
(
type
)){
backMessage
.
append
(
OperateEnum
.
OPERATE_OR
.
getDescribe
()).
append
(
" "
);
}
}
JSONArray
list
=
jsonObject
.
getJSONArray
(
"list"
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
for
(
int
j
=
0
;
j
<
list
.
size
();
j
++){
JSONObject
json
=
list
.
getJSONObject
(
j
);
String
key
=
json
.
getJSONObject
(
"data"
).
getString
(
"key"
);
String
value
=
json
.
getJSONObject
(
"data"
).
getString
(
"value"
);
String
compute
=
json
.
getJSONObject
(
"data"
).
getString
(
"compute"
);
String
message
=
this
.
strategyInit
.
getStrategyMap
().
get
(
key
).
screenBack
(
compute
,
value
,
key
,
enterpriseId
);
stringBuilder
.
append
(
message
);
if
(
j
<
list
.
size
()-
1
){
stringBuilder
.
append
(
"并且"
);
}
}
backMessage
.
append
(
stringBuilder
);
}
return
backMessage
.
toString
();
}
}
}
src/main/java/com/gic/plug/web/controller/StoreController.java
View file @
47326ba1
package
com
.
gic
.
plug
.
web
.
controller
;
package
com
.
gic
.
plug
.
web
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
...
@@ -8,6 +11,8 @@ import com.gic.plug.web.qo.StoreWidgetCountQO;
...
@@ -8,6 +11,8 @@ import com.gic.plug.web.qo.StoreWidgetCountQO;
import
com.gic.plug.web.qo.StoreWidgetQO
;
import
com.gic.plug.web.qo.StoreWidgetQO
;
import
com.gic.plug.web.vo.StoreRegionVO
;
import
com.gic.plug.web.vo.StoreRegionVO
;
import
com.gic.plug.web.vo.StoreVO
;
import
com.gic.plug.web.vo.StoreVO
;
import
com.gic.plug.web.vo.StoreWidgetVO
;
import
com.gic.search.business.api.constant.enums.OperateEnum
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreInfoDTO
;
import
com.gic.store.dto.StoreInfoDTO
;
import
com.gic.store.dto.StoreRegionDTO
;
import
com.gic.store.dto.StoreRegionDTO
;
...
@@ -16,9 +21,11 @@ import com.gic.store.dto.StoreWidgetDTO;
...
@@ -16,9 +21,11 @@ import com.gic.store.dto.StoreWidgetDTO;
import
com.gic.store.service.StoreApiService
;
import
com.gic.store.service.StoreApiService
;
import
com.gic.store.service.StoreRegionApiService
;
import
com.gic.store.service.StoreRegionApiService
;
import
com.gic.store.service.StoreWidgetApiService
;
import
com.gic.store.service.StoreWidgetApiService
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
...
@@ -98,6 +105,50 @@ public class StoreController {
...
@@ -98,6 +105,50 @@ public class StoreController {
@RequestMapping
(
"get-store-widget"
)
@RequestMapping
(
"get-store-widget"
)
public
RestResponse
getStoreWidget
(
Integer
storeWidgetId
){
public
RestResponse
getStoreWidget
(
Integer
storeWidgetId
){
ServiceResponse
<
StoreWidgetDTO
>
response
=
this
.
storeWidgetApiService
.
getStoreWidget
(
storeWidgetId
);
ServiceResponse
<
StoreWidgetDTO
>
response
=
this
.
storeWidgetApiService
.
getStoreWidget
(
storeWidgetId
);
return
RestResponse
.
success
(
response
.
getResult
());
StoreWidgetVO
storeWidgetVO
=
EntityUtil
.
changeEntityByJSON
(
StoreWidgetVO
.
class
,
response
.
getResult
());
storeWidgetVO
.
setScreenBack
(
this
.
getScreenBack
(
storeWidgetVO
.
getSearchParam
()));
return
RestResponse
.
success
(
storeWidgetVO
);
}
@RequestMapping
(
"screen-back"
)
@ResponseBody
public
Object
screenBack
(
String
param
){
return
RestResponse
.
success
(
this
.
getScreenBack
(
param
));
}
private
String
getScreenBack
(
String
param
)
{
if
(
StringUtils
.
isBlank
(
param
)){
return
""
;
}
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
JSONArray
array
=
JSON
.
parseArray
(
param
);
StringBuilder
backMessage
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
array
.
size
();
i
++){
JSONObject
jsonObject
=
array
.
getJSONObject
(
i
);
String
type
=
jsonObject
.
getString
(
"type"
);
if
(
StringUtils
.
isNotBlank
(
type
)){
if
(
OperateEnum
.
OPERATE_AND_NOT
.
getValue
().
equals
(
type
)){
backMessage
.
append
(
OperateEnum
.
OPERATE_AND_NOT
.
getDescribe
()).
append
(
" "
);
}
if
(
OperateEnum
.
OPERATE_OR
.
getValue
().
equals
(
type
)){
backMessage
.
append
(
OperateEnum
.
OPERATE_OR
.
getDescribe
()).
append
(
" "
);
}
}
JSONArray
list
=
jsonObject
.
getJSONArray
(
"list"
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
for
(
int
j
=
0
;
j
<
list
.
size
();
j
++){
JSONObject
json
=
list
.
getJSONObject
(
j
);
String
key
=
json
.
getJSONObject
(
"data"
).
getString
(
"key"
);
String
value
=
json
.
getJSONObject
(
"data"
).
getString
(
"value"
);
String
compute
=
json
.
getJSONObject
(
"data"
).
getString
(
"compute"
);
String
message
=
this
.
strategyInit
.
getStrategyMap
().
get
(
key
).
screenBack
(
compute
,
value
,
key
,
enterpriseId
);
stringBuilder
.
append
(
message
);
if
(
j
<
list
.
size
()-
1
){
stringBuilder
.
append
(
"并且"
);
}
}
backMessage
.
append
(
stringBuilder
);
}
return
backMessage
.
toString
();
}
}
}
}
src/main/java/com/gic/plug/web/vo/StoreWidgetVO.java
0 → 100644
View file @
47326ba1
package
com
.
gic
.
plug
.
web
.
vo
;
import
java.io.Serializable
;
/**
* tab_store_widget
*/
public
class
StoreWidgetVO
implements
Serializable
{
/**
*
*/
private
Integer
storeWidgetId
;
/**
*
*/
private
String
searchParam
;
/**
*
*/
private
String
writeBackParam
;
private
String
authSearchParam
;
private
Integer
authMode
=
1
;
private
String
screenBack
;
public
Integer
getStoreWidgetId
()
{
return
storeWidgetId
;
}
public
void
setStoreWidgetId
(
Integer
storeWidgetId
)
{
this
.
storeWidgetId
=
storeWidgetId
;
}
public
String
getSearchParam
()
{
return
searchParam
;
}
public
void
setSearchParam
(
String
searchParam
)
{
this
.
searchParam
=
searchParam
;
}
public
String
getWriteBackParam
()
{
return
writeBackParam
;
}
public
void
setWriteBackParam
(
String
writeBackParam
)
{
this
.
writeBackParam
=
writeBackParam
;
}
public
String
getAuthSearchParam
()
{
return
authSearchParam
;
}
public
void
setAuthSearchParam
(
String
authSearchParam
)
{
this
.
authSearchParam
=
authSearchParam
;
}
public
Integer
getAuthMode
()
{
return
authMode
;
}
public
void
setAuthMode
(
Integer
authMode
)
{
this
.
authMode
=
authMode
;
}
public
String
getScreenBack
()
{
return
screenBack
;
}
public
void
setScreenBack
(
String
screenBack
)
{
this
.
screenBack
=
screenBack
;
}
}
\ 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