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
8b610ab0
Commit
8b610ab0
authored
May 28, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回写修改
parent
af9a21d1
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
290 additions
and
103 deletions
+290
-103
StoreController.java
...ain/java/com/gic/plug/web/controller/StoreController.java
+11
-21
ScreenBackStrategy.java
...in/java/com/gic/plug/web/strategy/ScreenBackStrategy.java
+3
-1
StoreAreaBackImpl.java
...ava/com/gic/plug/web/strategy/impl/StoreAreaBackImpl.java
+18
-5
StoreBackImpl.java
...in/java/com/gic/plug/web/strategy/impl/StoreBackImpl.java
+18
-6
StoreBrandBackImpl.java
...va/com/gic/plug/web/strategy/impl/StoreBrandBackImpl.java
+17
-5
StoreCustomBackImpl.java
...a/com/gic/plug/web/strategy/impl/StoreCustomBackImpl.java
+33
-14
StoreGroupBackImpl.java
...va/com/gic/plug/web/strategy/impl/StoreGroupBackImpl.java
+17
-5
StoreRegionBackImpl.java
...a/com/gic/plug/web/strategy/impl/StoreRegionBackImpl.java
+15
-5
StoreSelectBackImpl.java
...a/com/gic/plug/web/strategy/impl/StoreSelectBackImpl.java
+67
-30
StoreTagBackImpl.java
...java/com/gic/plug/web/strategy/impl/StoreTagBackImpl.java
+17
-5
ScreenBack.java
src/main/java/com/gic/plug/web/vo/ScreenBack.java
+43
-0
ScreenBackVO.java
src/main/java/com/gic/plug/web/vo/ScreenBackVO.java
+24
-0
StoreResourceVO.java
src/main/java/com/gic/plug/web/vo/StoreResourceVO.java
+3
-3
StoreWidgetVO.java
src/main/java/com/gic/plug/web/vo/StoreWidgetVO.java
+4
-3
No files found.
src/main/java/com/gic/plug/web/controller/StoreController.java
View file @
8b610ab0
...
...
@@ -16,10 +16,7 @@ import com.gic.plug.web.qo.StoreWidgetCountQO;
import
com.gic.plug.web.qo.StoreWidgetQO
;
import
com.gic.plug.web.strategy.init.StrategyInit
;
import
com.gic.plug.web.utils.StoreRegionAuthUtil
;
import
com.gic.plug.web.vo.StoreRegionVO
;
import
com.gic.plug.web.vo.StoreResourceVO
;
import
com.gic.plug.web.vo.StoreVO
;
import
com.gic.plug.web.vo.StoreWidgetVO
;
import
com.gic.plug.web.vo.*
;
import
com.gic.search.business.api.constant.enums.OperateEnum
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreInfoDTO
;
...
...
@@ -168,39 +165,32 @@ public class StoreController {
return
RestResponse
.
success
(
new
StoreResourceVO
());
}
private
S
tring
getScreenBack
(
String
param
)
throws
ClassNotFoundException
{
private
S
creenBackVO
getScreenBack
(
String
param
)
throws
ClassNotFoundException
{
if
(
StringUtils
.
isBlank
(
param
)){
return
""
;
return
null
;
}
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
);
ScreenBackVO
screenBackVO
=
new
ScreenBackVO
();
List
<
ScreenBack
>
data
=
new
ArrayList
<>();
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
(
" "
);
}
screenBackVO
.
setType
(
type
);
}
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
(
"并且"
);
}
ScreenBack
screenBack
=
this
.
strategyInit
.
getStrategyMap
().
get
(
key
).
screenBack
(
compute
,
value
,
key
,
enterpriseId
);
data
.
add
(
screenBack
);
}
backMessage
.
append
(
stringBuilder
);
screenBackVO
.
setData
(
data
);
return
screenBackVO
;
}
return
backMessage
.
toString
()
;
return
null
;
}
}
src/main/java/com/gic/plug/web/strategy/ScreenBackStrategy.java
View file @
8b610ab0
package
com
.
gic
.
plug
.
web
.
strategy
;
import
com.gic.plug.web.vo.ScreenBack
;
public
interface
ScreenBackStrategy
{
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
throws
ClassNotFoundException
;
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
throws
ClassNotFoundException
;
}
src/main/java/com/gic/plug/web/strategy/impl/StoreAreaBackImpl.java
View file @
8b610ab0
...
...
@@ -3,6 +3,7 @@ package com.gic.plug.web.strategy.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.CityDTO
;
import
com.gic.store.dto.ProvinceDTO
;
...
...
@@ -12,6 +13,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
...
...
@@ -19,16 +21,20 @@ public class StoreAreaBackImpl implements ScreenBackStrategy {
@Autowired
private
ProvincesApiService
provincesApiService
;
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
)){
ServiceResponse
<
List
<
CityDTO
>>
cityResponse
=
this
.
provincesApiService
.
selectAllCity
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
AREAIDS
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
AREAIDS
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
if
(
cityResponse
.
isSuccess
()){
List
<
CityDTO
>
cityDTOList
=
cityResponse
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
cityDTOList
)){
String
[]
valueArr
=
value
.
split
(
" "
);
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
for
(
CityDTO
cityDTO
:
cityDTOList
){
int
index
=
0
;
for
(
String
s
:
valueArr
){
if
(
s
.
equals
(
cityDTO
.
getCityId
())){
String
provinceName
=
""
;
...
...
@@ -36,13 +42,20 @@ public class StoreAreaBackImpl implements ScreenBackStrategy {
if
(
provinceById
.
isSuccess
()){
provinceName
=
provinceById
.
getResult
().
getProvinceName
();
}
stringBuilder
.
append
(
"【"
).
append
(
cityDTO
.
getCityName
()).
append
(
"-"
).
append
(
provinceName
).
append
(
"】"
);
if
(
index
<
5
){
view
.
add
(
cityDTO
.
getCityName
()
+
"-"
+
provinceName
);
}
else
{
hideView
.
add
(
cityDTO
.
getCityName
()
+
"-"
+
provinceName
);
}
index
++;
}
}
}
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
}
return
stringBuilder
.
toString
();
}
return
screenBack
;
}
return
null
;
}
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreBackImpl.java
View file @
8b610ab0
...
...
@@ -5,6 +5,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreSearchDTO
;
...
...
@@ -14,6 +15,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
...
...
@@ -21,10 +23,11 @@ public class StoreBackImpl implements ScreenBackStrategy {
@Autowired
private
StoreApiService
storeApiService
;
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
STORENAME
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
STORENAME
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreIds
(
value
);
...
...
@@ -32,13 +35,22 @@ public class StoreBackImpl implements ScreenBackStrategy {
if
(
response
.
isSuccess
()){
List
<
StoreDTO
>
list
=
((
Page
)
response
.
getResult
()).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
int
index
=
0
;
for
(
StoreDTO
storeDTO
:
list
)
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
storeDTO
);
stringBuilder
.
append
(
"【"
).
append
(
jsonObject
.
getString
(
StoreESFieldsEnum
.
STORENAME
.
getField
())).
append
(
"】"
).
append
(
" "
);
if
(
index
<
5
){
view
.
add
(
storeDTO
.
getStoreName
());
}
else
{
hideView
.
add
(
storeDTO
.
getStoreName
());
}
index
++;
}
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
}
return
stringBuilder
.
toString
();
}
return
screenBack
;
}
return
null
;
}
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreBrandBackImpl.java
View file @
8b610ab0
...
...
@@ -3,6 +3,7 @@ package com.gic.plug.web.strategy.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreBrandDTO
;
import
com.gic.store.service.StoreBrandApiService
;
...
...
@@ -18,10 +19,11 @@ public class StoreBrandBackImpl implements ScreenBackStrategy {
@Autowired
private
StoreBrandApiService
storeBrandApiService
;
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
STOREBRANDIDLIST
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
STOREBRANDIDLIST
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
List
<
Integer
>
storeBrandIdList
=
new
ArrayList
<>();
String
[]
valueArr
=
value
.
split
(
" "
);
for
(
String
s
:
valueArr
){
...
...
@@ -30,11 +32,21 @@ public class StoreBrandBackImpl implements ScreenBackStrategy {
ServiceResponse
<
List
<
StoreBrandDTO
>>
listServiceResponse
=
this
.
storeBrandApiService
.
listStoreBrandByIds
(
storeBrandIdList
);
if
(
listServiceResponse
.
isSuccess
()){
List
<
StoreBrandDTO
>
list
=
listServiceResponse
.
getResult
();
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
int
index
=
0
;
for
(
StoreBrandDTO
storeBrandDTO
:
list
){
stringBuilder
.
append
(
"【"
).
append
(
storeBrandDTO
.
getStoreBrandName
()).
append
(
"】"
).
append
(
" "
);
if
(
index
<
5
){
view
.
add
(
storeBrandDTO
.
getStoreBrandName
());
}
else
{
hideView
.
add
(
storeBrandDTO
.
getStoreBrandName
());
}
index
++;
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
}
return
screenBack
;
}
return
null
;
}
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreCustomBackImpl.java
View file @
8b610ab0
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.constant.StoreFieldDateEnum
;
import
com.gic.store.constant.StoreFieldTypeEnum
;
...
...
@@ -46,7 +47,7 @@ public class StoreCustomBackImpl implements ScreenBackStrategy {
}
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
))
{
Object
cache
=
RedisUtil
.
getCache
(
StoreRedisKeyUtils
.
getStoreFieldKeyC
(
enterpriseId
,
key
));
if
(
cache
!=
null
)
{
...
...
@@ -67,9 +68,10 @@ public class StoreCustomBackImpl implements ScreenBackStrategy {
return
null
;
}
private
String
dateBack
(
String
compute
,
String
value
,
StoreFieldDTO
storeFieldDTO
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
(
storeFieldDTO
.
getStoreFieldName
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
private
ScreenBack
dateBack
(
String
compute
,
String
value
,
StoreFieldDTO
storeFieldDTO
)
{
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
storeFieldDTO
.
getStoreFieldName
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
JSONObject
jsonObject
=
JSON
.
parseObject
(
storeFieldDTO
.
getStoreFieldDetail
());
int
dateType
=
jsonObject
.
getIntValue
(
"dateType"
);
String
methodName
=
this
.
methodMap
.
get
(
dateType
);
...
...
@@ -79,7 +81,9 @@ public class StoreCustomBackImpl implements ScreenBackStrategy {
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
Class
.
forName
(
value
.
getClass
().
getCanonicalName
()));
try
{
String
message
=
(
String
)
method
.
invoke
(
this
,
value
);
return
stringBuilder
.
append
(
message
).
toString
();
List
<
String
>
view
=
new
ArrayList
<>();
view
.
add
(
message
);
return
screenBack
;
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
...
...
@@ -95,9 +99,10 @@ public class StoreCustomBackImpl implements ScreenBackStrategy {
return
null
;
}
private
String
selectBack
(
String
compute
,
String
value
,
Integer
enterpriseId
,
StoreFieldDTO
storeFieldDTO
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
(
storeFieldDTO
.
getStoreFieldName
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
private
ScreenBack
selectBack
(
String
compute
,
String
value
,
Integer
enterpriseId
,
StoreFieldDTO
storeFieldDTO
)
{
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
storeFieldDTO
.
getStoreFieldName
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
List
<
Integer
>
list
=
new
ArrayList
<>();
String
[]
valueArr
=
value
.
split
(
" "
);
for
(
String
s
:
valueArr
)
{
...
...
@@ -106,26 +111,40 @@ public class StoreCustomBackImpl implements ScreenBackStrategy {
ServiceResponse
<
List
<
StoreFieldSelectDTO
>>
listServiceResponse
=
this
.
storeFieldSelectApiService
.
listStoreFieldSelectByIds
(
enterpriseId
,
list
);
if
(
listServiceResponse
.
isSuccess
())
{
List
<
StoreFieldSelectDTO
>
selectDTOS
=
listServiceResponse
.
getResult
();
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
int
index
=
0
;
if
(
CollectionUtils
.
isNotEmpty
(
selectDTOS
))
{
for
(
StoreFieldSelectDTO
dto
:
selectDTOS
)
{
stringBuilder
.
append
(
"【"
).
append
(
dto
.
getStoreFieldSelectName
()).
append
(
"】"
).
append
(
" "
);
if
(
index
<
5
){
view
.
add
(
dto
.
getStoreFieldSelectName
());
}
else
{
hideView
.
add
(
dto
.
getStoreFieldSelectName
());
}
}
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
}
return
screenBack
;
}
private
String
numberBack
(
String
compute
,
String
value
,
StoreFieldDTO
storeFieldDTO
){
StringBuilder
stringBuilder
=
new
StringBuilder
(
storeFieldDTO
.
getStoreFieldName
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
private
ScreenBack
numberBack
(
String
compute
,
String
value
,
StoreFieldDTO
storeFieldDTO
){
StringBuilder
stringBuilder
=
new
StringBuilder
();
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
storeFieldDTO
.
getStoreFieldName
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
List
<
String
>
view
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
value
)){
String
[]
valueArr
=
value
.
split
(
" "
);
stringBuilder
.
append
(
valueArr
[
0
]);
if
(
valueArr
.
length
>
1
){
stringBuilder
.
append
(
" 至 "
).
append
(
valueArr
[
1
]);
}
view
.
add
(
stringBuilder
.
toString
());
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
return
screenBack
;
}
public
String
yyyyMMddHHmmssBack
(
String
value
)
throws
ParseException
{
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreGroupBackImpl.java
View file @
8b610ab0
...
...
@@ -3,6 +3,7 @@ package com.gic.plug.web.strategy.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreGroupDTO
;
import
com.gic.store.service.StoreGroupApiService
;
...
...
@@ -18,10 +19,11 @@ public class StoreGroupBackImpl implements ScreenBackStrategy {
@Autowired
private
StoreGroupApiService
storeGroupApiService
;
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
STOREGROUPIDLIST
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
STOREGROUPIDLIST
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
String
[]
valueArr
=
value
.
split
(
" "
);
List
<
Integer
>
storeGroupIdList
=
new
ArrayList
<>();
for
(
String
s
:
valueArr
){
...
...
@@ -30,12 +32,22 @@ public class StoreGroupBackImpl implements ScreenBackStrategy {
ServiceResponse
<
List
<
StoreGroupDTO
>>
listServiceResponse
=
this
.
storeGroupApiService
.
listStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
);
if
(
listServiceResponse
.
isSuccess
()){
if
(
listServiceResponse
.
getResult
()
!=
null
){
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
int
index
=
0
;
for
(
StoreGroupDTO
storeGroupDTO
:
listServiceResponse
.
getResult
()){
stringBuilder
.
append
(
"【"
).
append
(
storeGroupDTO
.
getStoreGroupName
()).
append
(
"】"
).
append
(
" "
);
if
(
index
<
5
){
view
.
add
(
storeGroupDTO
.
getStoreGroupName
());
}
else
{
hideView
.
add
(
storeGroupDTO
.
getStoreGroupName
());
}
index
++;
}
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
}
return
stringBuilder
.
toString
();
}
return
screenBack
;
}
return
null
;
}
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreRegionBackImpl.java
View file @
8b610ab0
...
...
@@ -3,6 +3,7 @@ package com.gic.plug.web.strategy.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreRegionDTO
;
import
com.gic.store.service.StoreRegionApiService
;
...
...
@@ -18,10 +19,11 @@ public class StoreRegionBackImpl implements ScreenBackStrategy {
@Autowired
private
StoreRegionApiService
storeRegionApiService
;
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
REGIONID
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
REGIONID
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
String
[]
valueArr
=
value
.
split
(
" "
);
List
<
Integer
>
storeRegionIdList
=
new
ArrayList
<>();
for
(
String
s
:
valueArr
){
...
...
@@ -30,12 +32,20 @@ public class StoreRegionBackImpl implements ScreenBackStrategy {
ServiceResponse
<
List
<
StoreRegionDTO
>>
listServiceResponse
=
this
.
storeRegionApiService
.
listStoreRegionByIds
(
enterpriseId
,
storeRegionIdList
);
if
(
listServiceResponse
.
isSuccess
()){
if
(
listServiceResponse
.
getResult
()
!=
null
){
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
int
index
=
0
;
for
(
StoreRegionDTO
storeRegionDTO
:
listServiceResponse
.
getResult
()){
stringBuilder
.
append
(
"【"
).
append
(
storeRegionDTO
.
getRegionName
()).
append
(
"】"
).
append
(
" "
);
if
(
index
<
5
){
view
.
add
(
storeRegionDTO
.
getRegionName
());
}
else
{
hideView
.
add
(
storeRegionDTO
.
getRegionName
());
}
index
++;
}
}
return
stringBuilder
.
toString
();
}
return
screenBack
;
}
return
null
;
}
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreSelectBackImpl.java
View file @
8b610ab0
...
...
@@ -3,6 +3,7 @@ package com.gic.plug.web.strategy.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.CreateTypeEnum
;
import
com.gic.store.constant.StoreCompleteEnum
;
import
com.gic.store.constant.StoreESFieldsEnum
;
...
...
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Component;
import
javax.annotation.PostConstruct
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -35,7 +37,7 @@ public class StoreSelectBackImpl implements ScreenBackStrategy {
methodMap
.
put
(
StoreESFieldsEnum
.
ERPSTATUS
.
getField
(),
"erpStatusBack"
);
}
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
){
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
){
String
methodName
=
methodMap
.
get
(
key
);
if
(
StringUtils
.
isNotBlank
(
methodName
)){
try
{
...
...
@@ -43,8 +45,8 @@ public class StoreSelectBackImpl implements ScreenBackStrategy {
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
Class
.
forName
(
compute
.
getClass
().
getCanonicalName
()),
Class
.
forName
(
value
.
getClass
().
getCanonicalName
()),
Class
.
forName
(
enterpriseId
.
getClass
().
getCanonicalName
()));
try
{
String
message
=
(
String
)
method
.
invoke
(
this
,
compute
,
value
,
enterpriseId
);
return
messag
e
;
Object
invoke
=
method
.
invoke
(
this
,
compute
,
value
,
enterpriseId
);
return
(
ScreenBack
)
invok
e
;
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
...
...
@@ -61,90 +63,125 @@ public class StoreSelectBackImpl implements ScreenBackStrategy {
}
//单选
public
S
tring
storeStatusBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
public
S
creenBack
storeStatusBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
STATUS
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
STATUS
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
List
<
String
>
view
=
new
ArrayList
<>();
for
(
StoreStatusEnum
storeStatusEnum
:
StoreStatusEnum
.
values
()){
if
(
storeStatusEnum
.
getCode
()
==
Integer
.
valueOf
(
value
)){
stringBuilder
.
append
(
"【"
).
append
(
storeStatusEnum
.
getMessage
()).
append
(
"】 "
);
view
.
add
(
storeStatusEnum
.
getMessage
()
);
}
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
return
screenBack
;
}
return
null
;
}
//单选
public
S
tring
storeCompleteBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
public
S
creenBack
storeCompleteBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
COMPLETESTATUS
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
COMPLETESTATUS
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
List
<
String
>
view
=
new
ArrayList
<>();
for
(
StoreCompleteEnum
storeStatusEnum
:
StoreCompleteEnum
.
values
()){
if
(
storeStatusEnum
.
getCode
()
==
Integer
.
valueOf
(
value
)){
stringBuilder
.
append
(
"【"
).
append
(
storeStatusEnum
.
getMessage
()).
append
(
"】 "
);
view
.
add
(
storeStatusEnum
.
getMessage
()
);
}
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
return
screenBack
;
}
return
null
;
}
//多选
public
S
tring
storeCreateTypeBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
public
S
creenBack
storeCreateTypeBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
CREATETYPE
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
CREATETYPE
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
int
index
=
0
;
String
[]
valueArr
=
value
.
split
(
" "
);
for
(
String
v
:
valueArr
){
for
(
CreateTypeEnum
createTypeEnum
:
CreateTypeEnum
.
values
()){
if
(
createTypeEnum
.
getCode
()
==
Integer
.
valueOf
(
v
)){
stringBuilder
.
append
(
"【"
).
append
(
createTypeEnum
.
getMessage
()).
append
(
"】 "
);
if
(
index
<
5
){
view
.
add
(
createTypeEnum
.
getMessage
());
}
else
{
hideView
.
add
(
createTypeEnum
.
getMessage
());
}
}
}
return
stringBuilder
.
toString
();
}
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
return
screenBack
;
}
return
null
;
}
//多选
public
S
tring
storeTypeBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
public
S
creenBack
storeTypeBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
if
(
StringUtils
.
isNotBlank
(
value
)){
String
[]
valueArr
=
value
.
split
(
" "
);
ServiceResponse
<
List
<
StoreDictDTO
>>
serviceResponse
=
this
.
storeDictApiService
.
listStoreType
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
()){
List
<
StoreDictDTO
>
list
=
serviceResponse
.
getResult
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
STORETYPE
.
getDesc
());
stringBuilder
.
append
(
" "
).
append
(
ComputeBackUtil
.
getComputeBack
(
compute
));
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
STORETYPE
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
int
index
=
0
;
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
for
(
StoreDictDTO
dictDTO
:
list
){
for
(
String
v
:
valueArr
){
if
(
dictDTO
.
getValue
().
equals
(
v
)){
stringBuilder
.
append
(
" 【"
);
stringBuilder
.
append
(
dictDTO
.
getKey
()).
append
(
"】 "
);
if
(
index
<
5
){
view
.
add
(
dictDTO
.
getKey
());
}
else
{
hideView
.
add
(
dictDTO
.
getKey
());
}
index
++;
}
}
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
return
screenBack
;
}
}
return
null
;
}
//多选
public
S
tring
erpStatusBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
public
S
creenBack
erpStatusBack
(
String
compute
,
String
value
,
Integer
enterpriseId
){
if
(
StringUtils
.
isNotBlank
(
value
)){
String
[]
valueArr
=
value
.
split
(
" "
);
ServiceResponse
<
List
<
StoreDictDTO
>>
serviceResponse
=
this
.
storeDictApiService
.
listStoreStatus
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
()){
List
<
StoreDictDTO
>
list
=
serviceResponse
.
getResult
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
ERPSTATUS
.
getDesc
());
stringBuilder
.
append
(
" "
).
append
(
ComputeBackUtil
.
getComputeBack
(
compute
));
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
ERPSTATUS
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
int
index
=
0
;
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
for
(
StoreDictDTO
dictDTO
:
list
){
for
(
String
v
:
valueArr
){
if
(
dictDTO
.
getValue
().
equals
(
v
)){
stringBuilder
.
append
(
" 【"
);
stringBuilder
.
append
(
dictDTO
.
getKey
()).
append
(
"】 "
);
if
(
index
<
5
){
view
.
add
(
dictDTO
.
getKey
());
}
else
{
hideView
.
add
(
dictDTO
.
getKey
());
}
}
}
}
return
stringBuilder
.
toString
();
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
return
screenBack
;
}
}
return
null
;
...
...
src/main/java/com/gic/plug/web/strategy/impl/StoreTagBackImpl.java
View file @
8b610ab0
...
...
@@ -3,6 +3,7 @@ package com.gic.plug.web.strategy.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.utils.ComputeBackUtil
;
import
com.gic.plug.web.vo.ScreenBack
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreGroupDTO
;
import
com.gic.store.dto.StoreTagDTO
;
...
...
@@ -19,18 +20,29 @@ public class StoreTagBackImpl implements ScreenBackStrategy {
@Autowired
private
StoreTagApiService
storeTagApiService
;
@Override
public
S
tring
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
public
S
creenBack
screenBack
(
String
compute
,
String
value
,
String
key
,
Integer
enterpriseId
)
{
if
(
StringUtils
.
isNotBlank
(
value
)){
StringBuilder
stringBuilder
=
new
StringBuilder
(
StoreESFieldsEnum
.
STORETAG
.
getDesc
()).
append
(
" "
);
stringBuilder
.
append
(
ComputeBackUtil
.
getComputeBack
(
compute
)).
append
(
" "
);
ScreenBack
screenBack
=
new
ScreenBack
();
screenBack
.
setTitle
(
StoreESFieldsEnum
.
STORETAG
.
getDesc
());
screenBack
.
setCompute
(
ComputeBackUtil
.
getComputeBack
(
compute
));
String
[]
valueArr
=
value
.
split
(
" "
);
int
index
=
0
;
List
<
String
>
view
=
new
ArrayList
<>();
List
<
String
>
hideView
=
new
ArrayList
<>();
for
(
String
s
:
valueArr
){
ServiceResponse
<
StoreTagDTO
>
response
=
this
.
storeTagApiService
.
getByStoreTagId
(
Integer
.
valueOf
(
s
));
if
(
response
.
isSuccess
()
&&
response
.
getResult
()!=
null
){
stringBuilder
.
append
(
"【"
).
append
(
response
.
getResult
().
getStoreTagName
()).
append
(
"】"
).
append
(
" "
);
if
(
index
<
0
){
view
.
add
(
response
.
getResult
().
getStoreTagName
());
}
else
{
hideView
.
add
(
response
.
getResult
().
getStoreTagName
());
}
index
++;
}
return
stringBuilder
.
toString
();
}
screenBack
.
setView
(
view
);
screenBack
.
setHideView
(
hideView
);
return
screenBack
;
}
return
null
;
}
...
...
src/main/java/com/gic/plug/web/vo/ScreenBack.java
0 → 100644
View file @
8b610ab0
package
com
.
gic
.
plug
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
ScreenBack
implements
Serializable
{
private
String
title
;
private
String
compute
;
private
List
<
String
>
view
;
private
List
<
String
>
hideView
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getCompute
()
{
return
compute
;
}
public
void
setCompute
(
String
compute
)
{
this
.
compute
=
compute
;
}
public
List
<
String
>
getView
()
{
return
view
;
}
public
void
setView
(
List
<
String
>
view
)
{
this
.
view
=
view
;
}
public
List
<
String
>
getHideView
()
{
return
hideView
;
}
public
void
setHideView
(
List
<
String
>
hideView
)
{
this
.
hideView
=
hideView
;
}
}
src/main/java/com/gic/plug/web/vo/ScreenBackVO.java
0 → 100644
View file @
8b610ab0
package
com
.
gic
.
plug
.
web
.
vo
;
import
java.util.List
;
public
class
ScreenBackVO
{
private
String
type
=
"and"
;
private
List
<
ScreenBack
>
data
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
List
<
ScreenBack
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
ScreenBack
>
data
)
{
this
.
data
=
data
;
}
}
src/main/java/com/gic/plug/web/vo/StoreResourceVO.java
View file @
8b610ab0
...
...
@@ -3,7 +3,7 @@ package com.gic.plug.web.vo;
public
class
StoreResourceVO
{
private
Integer
authMode
;
private
String
searchJson
;
private
S
tring
sceenBack
;
private
S
creenBackVO
sceenBack
;
public
Integer
getAuthMode
()
{
return
authMode
;
...
...
@@ -21,11 +21,11 @@ public class StoreResourceVO {
this
.
searchJson
=
searchJson
;
}
public
S
tring
getSceenBack
()
{
public
S
creenBackVO
getSceenBack
()
{
return
sceenBack
;
}
public
void
setSceenBack
(
S
tring
sceenBack
)
{
public
void
setSceenBack
(
S
creenBackVO
sceenBack
)
{
this
.
sceenBack
=
sceenBack
;
}
}
src/main/java/com/gic/plug/web/vo/StoreWidgetVO.java
View file @
8b610ab0
...
...
@@ -24,7 +24,7 @@ public class StoreWidgetVO implements Serializable {
private
String
authSearchParam
;
private
Integer
authMode
=
1
;
private
S
tring
screenBack
;
private
S
creenBackVO
screenBack
;
public
Integer
getStoreWidgetId
()
{
return
storeWidgetId
;
...
...
@@ -66,11 +66,11 @@ public class StoreWidgetVO implements Serializable {
this
.
authMode
=
authMode
;
}
public
S
tring
getScreenBack
()
{
public
S
creenBackVO
getScreenBack
()
{
return
screenBack
;
}
public
void
setScreenBack
(
S
tring
screenBack
)
{
public
void
setScreenBack
(
S
creenBackVO
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