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
0b6e172a
Commit
0b6e172a
authored
Aug 28, 2019
by
何文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新goods包
parent
1b550001
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
156 additions
and
0 deletions
+156
-0
GoodsDomainController.java
.../gic/plug/web/controller/goods/GoodsDomainController.java
+77
-0
GoodsQO.java
src/main/java/com/gic/plug/web/qo/goods/GoodsQO.java
+4
-0
GoodsChannelVO.java
src/main/java/com/gic/plug/web/vo/goods/GoodsChannelVO.java
+36
-0
GoodsDomainVO.java
src/main/java/com/gic/plug/web/vo/goods/GoodsDomainVO.java
+34
-0
dubbo-gic-webapp-plug.xml
src/main/resources/dubbo-gic-webapp-plug.xml
+5
-0
No files found.
src/main/java/com/gic/plug/web/controller/goods/GoodsDomainController.java
0 → 100644
View file @
0b6e172a
package
com
.
gic
.
plug
.
web
.
controller
.
goods
;
import
java.util.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.goods.api.dto.GoodsDomainDTO
;
import
com.gic.goods.api.service.GoodsDomainApiService
;
import
com.gic.goods.api.util.Constant
;
import
com.gic.plug.web.vo.goods.GoodsChannelVO
;
import
com.gic.plug.web.vo.goods.GoodsDomainVO
;
@RestController
public
class
GoodsDomainController
{
private
static
Map
<
String
,
String
>
channelCodeAndName
;
static
{
channelCodeAndName
=
new
HashMap
<>();
channelCodeAndName
.
put
(
Constant
.
CHANNEL_CODE_ERP
,
"ERP"
);
channelCodeAndName
.
put
(
Constant
.
CHANNEL_CODE_WEIMOB
,
"微盟"
);
channelCodeAndName
.
put
(
Constant
.
CHANNEL_CODE_MALL
,
"GIC微商城"
);
}
@Autowired
private
GoodsDomainApiService
goodsDomainApiService
;
/**
* @Title: getAllGoodsDomianListWith
* @Description: 查询企业下所有的域,拼接成channelVO返回
* @author majia
* @return com.gic.commons.webapi.reponse.RestResponse
* @throws
*/
@RequestMapping
(
"/get-all-goods-domain-list"
)
private
RestResponse
getAllGoodsDomianListWith
()
{
ServiceResponse
<
List
<
GoodsDomainDTO
>>
serviceResponse
=
goodsDomainApiService
.
listAll
(
Constant
.
TEST_ENTERPRISE_ID
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
List
<
GoodsDomainDTO
>
goodsDomainDTOList
=
serviceResponse
.
getResult
();
Map
<
String
,
List
<
GoodsDomainDTO
>>
map
=
new
TreeMap
<>();
if
(
CollectionUtils
.
isEmpty
(
goodsDomainDTOList
))
{
return
RestResponse
.
success
(
Collections
.
EMPTY_LIST
);
}
for
(
GoodsDomainDTO
goodsDomainDTO
:
goodsDomainDTOList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
goodsDomainDTO
.
getChannels
())){
for
(
String
channelCode
:
goodsDomainDTO
.
getChannels
())
{
map
.
putIfAbsent
(
channelCode
,
new
ArrayList
<>());
map
.
get
(
channelCode
).
add
(
goodsDomainDTO
);
}
}
}
List
<
GoodsChannelVO
>
resultList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
List
<
GoodsDomainDTO
>>
entry
:
map
.
entrySet
())
{
GoodsChannelVO
goodsChannelVO
=
new
GoodsChannelVO
();
goodsChannelVO
.
setChannelCode
(
entry
.
getKey
());
goodsChannelVO
.
setChannelName
(
channelCodeAndName
.
get
(
entry
.
getKey
()));
goodsChannelVO
.
setGoodsDomainList
(
new
ArrayList
<>());
for
(
GoodsDomainDTO
goodsDomainDTO
:
entry
.
getValue
())
{
GoodsDomainVO
goodsDomainVO
=
new
GoodsDomainVO
();
goodsDomainVO
.
setDomainCode
(
goodsDomainDTO
.
getCode
());
goodsDomainVO
.
setDomainId
(
goodsDomainDTO
.
getGoodsDomainId
());
goodsDomainVO
.
setDomainName
(
goodsDomainDTO
.
getName
());
goodsChannelVO
.
getGoodsDomainList
().
add
(
goodsDomainVO
);
}
resultList
.
add
(
goodsChannelVO
);
}
return
RestResponse
.
success
(
resultList
);
}
}
src/main/java/com/gic/plug/web/qo/goods/GoodsQO.java
0 → 100644
View file @
0b6e172a
package
com
.
gic
.
plug
.
web
.
qo
.
goods
;
public
class
GoodsQO
{
}
src/main/java/com/gic/plug/web/vo/goods/GoodsChannelVO.java
0 → 100644
View file @
0b6e172a
package
com
.
gic
.
plug
.
web
.
vo
.
goods
;
import
java.util.List
;
public
class
GoodsChannelVO
{
private
String
channelCode
;
private
String
channelName
;
private
List
<
GoodsDomainVO
>
goodsDomainList
;
public
String
getChannelCode
()
{
return
channelCode
;
}
public
void
setChannelCode
(
String
channelCode
)
{
this
.
channelCode
=
channelCode
;
}
public
String
getChannelName
()
{
return
channelName
;
}
public
void
setChannelName
(
String
channelName
)
{
this
.
channelName
=
channelName
;
}
public
List
<
GoodsDomainVO
>
getGoodsDomainList
()
{
return
goodsDomainList
;
}
public
void
setGoodsDomainList
(
List
<
GoodsDomainVO
>
goodsDomainList
)
{
this
.
goodsDomainList
=
goodsDomainList
;
}
}
src/main/java/com/gic/plug/web/vo/goods/GoodsDomainVO.java
0 → 100644
View file @
0b6e172a
package
com
.
gic
.
plug
.
web
.
vo
.
goods
;
public
class
GoodsDomainVO
{
private
String
domainCode
;
private
String
domainName
;
private
Long
domainId
;
public
String
getDomainCode
()
{
return
domainCode
;
}
public
void
setDomainCode
(
String
domainCode
)
{
this
.
domainCode
=
domainCode
;
}
public
String
getDomainName
()
{
return
domainName
;
}
public
void
setDomainName
(
String
domainName
)
{
this
.
domainName
=
domainName
;
}
public
Long
getDomainId
()
{
return
domainId
;
}
public
void
setDomainId
(
Long
domainId
)
{
this
.
domainId
=
domainId
;
}
}
src/main/resources/dubbo-gic-webapp-plug.xml
View file @
0b6e172a
...
...
@@ -31,4 +31,8 @@
<dubbo:reference
interface=
"com.gic.store.service.StoreStrategyApiService"
id=
"storeStrategyApiService"
timeout=
"60000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.widget.screening.api.service.EsScreeningInitService"
id=
"esScreeningInitService"
timeout=
"60000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.widget.screening.api.service.EsScreeningTemplateService"
id=
"esScreeningTemplateService"
timeout=
"60000"
retries=
"0"
/>
<!-- 商品 -->
<dubbo:reference
interface=
"com.gic.goods.api.service.GoodsDomainApiService"
id=
"goodsDomainApiService"
timeout=
"60000"
retries=
"0"
/>
<!-- -->
</beans>
\ 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