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
f76e213f
Commit
f76e213f
authored
Jul 22, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询门店选择器配置
parent
0e441cc1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
6 deletions
+45
-6
pom.xml
pom.xml
+6
-0
Main.java
src/main/java/com/gic/plug/web/Main.java
+13
-2
StoreFieldController.java
...ava/com/gic/plug/web/controller/StoreFieldController.java
+16
-4
StoreFieldRegionVO.java
src/main/java/com/gic/plug/web/vo/StoreFieldRegionVO.java
+10
-0
No files found.
pom.xml
View file @
f76e213f
...
...
@@ -22,6 +22,7 @@
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-store-api>
4.0-SNAPSHOT
</gic-store-api>
<gic-thirdparty-sdk>
4.0-SNAPSHOT
</gic-thirdparty-sdk>
<gic-redis-data>
4.0-SNAPSHOT
</gic-redis-data>
</properties>
<dependencies>
...
...
@@ -117,6 +118,11 @@
<artifactId>
gic-enterprise-base-api
</artifactId>
<version>
${gic-enterprise-base-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-redis-data
</artifactId>
<version>
${gic-redis-data}
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/gic/plug/web/Main.java
View file @
f76e213f
...
...
@@ -3,6 +3,9 @@ package com.gic.plug.web;
import
com.gic.dubbo.util.DubboContextUtil
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ImportResource
;
...
...
@@ -11,12 +14,20 @@ import org.springframework.context.annotation.ImportResource;
*
* @author zhurz
*/
@SpringBootApplication
@SpringBootApplication
(
scanBasePackages
=
"com.gic"
,
exclude
=
{
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
,
QuartzAutoConfiguration
.
class
}
)
@ImportResource
(
value
=
{
"classpath*:applicationContext-init.xml"
,
"classpath*:dubbo-setting.xml"
,
"classpath*:dubbo-gic-webapp-plug.xml"
,
"classpath*:spring-interceptor.xml"
"classpath*:spring-interceptor.xml"
,
"classpath*:redis-init.xml"
})
public
class
Main
{
...
...
src/main/java/com/gic/plug/web/controller/StoreFieldController.java
View file @
f76e213f
...
...
@@ -4,8 +4,10 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.plug.web.vo.StoreFieldRegionVO
;
import
com.gic.plug.web.vo.StoreFieldSelectVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.constant.StoreFieldDateEnum
;
import
com.gic.store.constant.StoreFieldTextEnum
;
import
com.gic.store.constant.StoreFieldTypeEnum
;
...
...
@@ -72,12 +74,13 @@ public class StoreFieldController {
@RequestMapping
(
"/list-store-field-by-region-id"
)
public
RestResponse
listStoreFieldByRegionId
(
Integer
regionId
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
if
(
regionId
==
null
)
{
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"域ID不能为空"
);
}
ServiceResponse
<
List
<
StoreFieldDTO
>>
result
=
storeFieldApiService
.
listStoreFieldByRegionId
(
regionId
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
transferDtoToVo
(
result
.
getResult
()));
return
RestResponse
.
success
(
transferDtoToVo
(
result
.
getResult
()
,
enterpriseId
));
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
...
...
@@ -85,9 +88,11 @@ public class StoreFieldController {
@RequestMapping
(
"/list-store-field"
)
public
RestResponse
listStoreField
(
String
search
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
List
<
StoreFieldDTO
>>
result
=
storeFieldApiService
.
listStoreField
(
StoreGroupConstant
.
TEST_ENTERPRISE_ID
,
search
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
transferDtoToVo
(
result
.
getResult
()));
return
RestResponse
.
success
(
transferDtoToVo
(
result
.
getResult
()
,
enterpriseId
));
}
else
{
return
RestResponse
.
failure
(
result
.
getCode
(),
result
.
getMessage
());
}
...
...
@@ -103,12 +108,19 @@ public class StoreFieldController {
}
}
private
List
<
StoreFieldRegionVO
>
transferDtoToVo
(
List
<
StoreFieldDTO
>
dtoList
)
{
private
List
<
StoreFieldRegionVO
>
transferDtoToVo
(
List
<
StoreFieldDTO
>
dtoList
,
Integer
enterpriseId
)
{
String
key
=
"enterprise:store:storeField:"
+
enterpriseId
+
":"
;
List
<
StoreFieldRegionVO
>
voList
=
new
ArrayList
<>(
dtoList
.
size
());
for
(
StoreFieldDTO
dto
:
dtoList
)
{
//不需要文本类型字段
if
(
dto
.
getStoreFieldType
().
intValue
()
!=
StoreFieldTypeEnum
.
TEXT
.
getCode
())
{
voList
.
add
(
EntityUtil
.
changeEntityNew
(
StoreFieldRegionVO
.
class
,
dto
));
Object
obj
=
RedisUtil
.
getCache
(
key
+
dto
.
getStoreFieldId
());
if
(
obj
!=
null
){
StoreFieldRegionVO
vo
=
EntityUtil
.
changeEntityNew
(
StoreFieldRegionVO
.
class
,
dto
);
vo
.
setStoreFieldKey
(
obj
.
toString
());
voList
.
add
(
vo
);
}
}
}
return
voList
;
...
...
src/main/java/com/gic/plug/web/vo/StoreFieldRegionVO.java
View file @
f76e213f
...
...
@@ -22,6 +22,8 @@ public class StoreFieldRegionVO implements Serializable{
*/
private
Integer
storeFieldType
;
private
String
storeFieldKey
;
/**
* 排序
*/
...
...
@@ -66,4 +68,12 @@ public class StoreFieldRegionVO implements Serializable{
public
void
setSort
(
Double
sort
)
{
this
.
sort
=
sort
;
}
public
String
getStoreFieldKey
()
{
return
storeFieldKey
;
}
public
void
setStoreFieldKey
(
String
storeFieldKey
)
{
this
.
storeFieldKey
=
storeFieldKey
;
}
}
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