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
4371e7ab
Commit
4371e7ab
authored
Aug 13, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缩略信息返回
parent
456e202a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
44 deletions
+99
-44
ScreeningController.java
...java/com/gic/plug/web/controller/ScreeningController.java
+5
-44
StrategyInit.java
...ain/java/com/gic/plug/web/strategy/init/StrategyInit.java
+94
-0
No files found.
src/main/java/com/gic/plug/web/controller/ScreeningController.java
View file @
4371e7ab
...
...
@@ -15,6 +15,7 @@ import com.gic.enterprise.constants.Constants;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.strategy.impl.*
;
import
com.gic.plug.web.strategy.init.StrategyInit
;
import
com.gic.search.business.api.constant.enums.OperateEnum
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.widget.screening.api.dto.*
;
...
...
@@ -46,48 +47,8 @@ public class ScreeningController {
@Autowired
private
EsScreeningTemplateService
esScreeningTemplateService
;
@Autowired
private
StoreAreaBackImpl
storeAreaBack
;
@Autowired
private
StoreBackImpl
storeBack
;
@Autowired
private
StoreBrandBackImpl
storeBrandBack
;
@Autowired
private
StoreCustomBackImpl
storeCustomBack
;
@Autowired
private
StoreGroupBackImpl
storeGroupBack
;
@Autowired
private
StoreRegionBackImpl
storeRegionBack
;
@Autowired
private
StoreSelectBackImpl
storeSelectBack
;
@Autowired
private
StoreTagBackImpl
storeTagBack
;
private
Map
<
String
,
ScreenBackStrategy
>
strategyMap
=
new
HashMap
<>();
private
StrategyInit
strategyInit
;
@PostConstruct
public
void
init
(){
strategyMap
.
put
(
StoreESFieldsEnum
.
AREAIDS
.
getField
(),
storeAreaBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
STOREID
.
getField
(),
storeBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
STOREBRANDIDLIST
.
getField
(),
storeBrandBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
STOREGROUPIDLIST
.
getField
(),
storeGroupBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
REGIONID
.
getField
(),
storeRegionBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
STATUS
.
getField
(),
storeSelectBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
COMPLETESTATUS
.
getField
(),
storeSelectBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
CREATETYPE
.
getField
(),
storeSelectBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
STORETYPE
.
getField
(),
storeSelectBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
ERPSTATUS
.
getField
(),
storeSelectBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
STORETAG
.
getField
(),
storeTagBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C1
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C2
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C3
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C4
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C5
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C6
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C7
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C8
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C9
.
getField
(),
storeCustomBack
);
strategyMap
.
put
(
StoreESFieldsEnum
.
C10
.
getField
(),
storeCustomBack
);
System
.
out
.
println
(
"对象初始化完成"
);
}
/**
* @return
* @throws
...
...
@@ -153,7 +114,7 @@ public class ScreeningController {
@RequestMapping
(
"screen-back"
)
@ResponseBody
public
String
screenBack
(
String
param
)
throws
ClassNotFoundException
{
public
Object
screenBack
(
String
param
)
throws
ClassNotFoundException
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
JSONArray
array
=
JSON
.
parseArray
(
param
);
StringBuilder
backMessage
=
new
StringBuilder
();
...
...
@@ -175,7 +136,7 @@ public class ScreeningController {
String
key
=
json
.
getJSONObject
(
"data"
).
getString
(
"key"
);
String
value
=
json
.
getJSONObject
(
"data"
).
getString
(
"value"
);
String
compute
=
json
.
getJSONObject
(
"data"
).
getString
(
"compute"
);
String
message
=
strategyMap
.
get
(
key
).
screenBack
(
compute
,
value
,
key
,
enterpriseId
);
String
message
=
this
.
strategyInit
.
getStrategyMap
()
.
get
(
key
).
screenBack
(
compute
,
value
,
key
,
enterpriseId
);
stringBuilder
.
append
(
message
);
if
(
j
<
list
.
size
()-
1
){
stringBuilder
.
append
(
"并且"
);
...
...
@@ -184,6 +145,6 @@ public class ScreeningController {
stringBuilder
.
append
(
")"
);
backMessage
.
append
(
stringBuilder
);
}
return
backMessage
.
toString
(
);
return
RestResponse
.
success
(
backMessage
.
toString
()
);
}
}
src/main/java/com/gic/plug/web/strategy/init/StrategyInit.java
0 → 100644
View file @
4371e7ab
package
com
.
gic
.
plug
.
web
.
strategy
.
init
;
import
com.gic.plug.web.strategy.ScreenBackStrategy
;
import
com.gic.plug.web.strategy.impl.*
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.HashMap
;
import
java.util.Map
;
@Component
public
class
StrategyInit
{
@Autowired
private
StoreAreaBackImpl
storeAreaBack
;
@Autowired
private
StoreBackImpl
storeBack
;
@Autowired
private
StoreBrandBackImpl
storeBrandBack
;
@Autowired
private
StoreCustomBackImpl
storeCustomBack
;
@Autowired
private
StoreGroupBackImpl
storeGroupBack
;
@Autowired
private
StoreRegionBackImpl
storeRegionBack
;
@Autowired
private
StoreSelectBackImpl
storeSelectBack
;
@Autowired
private
StoreTagBackImpl
storeTagBack
;
private
Map
<
String
,
ScreenBackStrategy
>
strategyMap
=
new
HashMap
<>();
@PostConstruct
public
void
init
(){
strategyMap
.
put
(
StoreESFieldsEnum
.
AREAIDS
.
getField
(),
this
.
getStoreAreaBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
STOREID
.
getField
(),
this
.
getStoreBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
STOREBRANDIDLIST
.
getField
(),
this
.
getStoreBrandBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
STOREGROUPIDLIST
.
getField
(),
this
.
getStoreGroupBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
REGIONID
.
getField
(),
this
.
getStoreRegionBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
STATUS
.
getField
(),
this
.
getStoreSelectBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
COMPLETESTATUS
.
getField
(),
this
.
getStoreSelectBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
CREATETYPE
.
getField
(),
this
.
getStoreSelectBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
STORETYPE
.
getField
(),
this
.
getStoreSelectBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
ERPSTATUS
.
getField
(),
this
.
getStoreSelectBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
STORETAG
.
getField
(),
this
.
getStoreTagBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C1
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C2
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C3
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C4
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C5
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C6
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C7
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C8
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C9
.
getField
(),
this
.
getStoreCustomBack
());
strategyMap
.
put
(
StoreESFieldsEnum
.
C10
.
getField
(),
this
.
getStoreCustomBack
());
System
.
out
.
println
(
"对象初始化完成"
);
}
public
StoreAreaBackImpl
getStoreAreaBack
()
{
return
storeAreaBack
;
}
public
StoreBackImpl
getStoreBack
()
{
return
storeBack
;
}
public
StoreBrandBackImpl
getStoreBrandBack
()
{
return
storeBrandBack
;
}
public
StoreCustomBackImpl
getStoreCustomBack
()
{
return
storeCustomBack
;
}
public
StoreGroupBackImpl
getStoreGroupBack
()
{
return
storeGroupBack
;
}
public
StoreRegionBackImpl
getStoreRegionBack
()
{
return
storeRegionBack
;
}
public
StoreSelectBackImpl
getStoreSelectBack
()
{
return
storeSelectBack
;
}
public
StoreTagBackImpl
getStoreTagBack
()
{
return
storeTagBack
;
}
public
Map
<
String
,
ScreenBackStrategy
>
getStrategyMap
()
{
return
strategyMap
;
}
}
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