Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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-store
Commits
4e436d02
Commit
4e436d02
authored
Jul 15, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/base_platform_enterprise/gic-store
into developer
parents
d6df0a47
09d292bb
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
165 additions
and
9 deletions
+165
-9
StoreColumnSet.java
...e-api/src/main/java/com/gic/store/dto/StoreColumnSet.java
+52
-0
StoreGroupApiService.java
...main/java/com/gic/store/service/StoreGroupApiService.java
+19
-0
StoreWidgetApiService.java
...ain/java/com/gic/store/service/StoreWidgetApiService.java
+4
-0
TabStoreGroupMapper.java
...in/java/com/gic/store/dao/mapper/TabStoreGroupMapper.java
+9
-1
StoreGroupService.java
...rc/main/java/com/gic/store/service/StoreGroupService.java
+4
-1
StoreGroupServiceImpl.java
...ava/com/gic/store/service/impl/StoreGroupServiceImpl.java
+8
-2
StoreGroupApiServiceImpl.java
...ic/store/service/outer/impl/StoreGroupApiServiceImpl.java
+19
-1
StoreWidgetApiServiceImpl.java
...c/store/service/outer/impl/StoreWidgetApiServiceImpl.java
+31
-4
TabStoreGroupMapper.xml
...service/src/main/resources/mapper/TabStoreGroupMapper.xml
+19
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreColumnSet.java
0 → 100644
View file @
4e436d02
package
com
.
gic
.
store
.
dto
;
import
java.util.HashSet
;
import
java.util.Set
;
public
class
StoreColumnSet
{
private
Set
<
Integer
>
storeType
=
new
HashSet
<>();
private
Set
<
Integer
>
status
=
new
HashSet
<>();
private
Set
<
Integer
>
ErpStatus
=
new
HashSet
<>();
private
Set
<
Integer
>
storeGroupId
=
new
HashSet
<>();
private
Set
<
Integer
>
region
=
new
HashSet
<>();
public
Set
<
Integer
>
getStoreType
()
{
return
storeType
;
}
public
void
setStoreType
(
Set
<
Integer
>
storeType
)
{
this
.
storeType
=
storeType
;
}
public
Set
<
Integer
>
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Set
<
Integer
>
status
)
{
this
.
status
=
status
;
}
public
Set
<
Integer
>
getErpStatus
()
{
return
ErpStatus
;
}
public
void
setErpStatus
(
Set
<
Integer
>
erpStatus
)
{
ErpStatus
=
erpStatus
;
}
public
Set
<
Integer
>
getStoreGroupId
()
{
return
storeGroupId
;
}
public
void
setStoreGroupId
(
Set
<
Integer
>
storeGroupId
)
{
this
.
storeGroupId
=
storeGroupId
;
}
public
Set
<
Integer
>
getRegion
()
{
return
region
;
}
public
void
setRegion
(
Set
<
Integer
>
region
)
{
this
.
region
=
region
;
}
}
gic-store-api/src/main/java/com/gic/store/service/StoreGroupApiService.java
View file @
4e436d02
...
...
@@ -2,6 +2,7 @@ package com.gic.store.service;
import
java.util.List
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.store.dto.StoreGroupDTO
;
...
...
@@ -156,4 +157,22 @@ public interface StoreGroupApiService {
* @return
*/
ServiceResponse
<
List
<
StoreGroupDTO
>>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
);
/** @Description: 通过分组id查询分组
* @author taogs
* @Date 18:44 2019/8/12
* @Param
* @return
*/
ServiceResponse
<
List
<
StoreGroupDTO
>>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
level
);
/** @Description: 分页查询分组
* @author taogs
* @Date 10:31 2020/7/15
* @Param
* @return
*/
ServiceResponse
<
Page
<
StoreGroupDTO
>>
pageStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
parentId
,
Integer
pageSize
,
Integer
pageNum
);
}
gic-store-api/src/main/java/com/gic/store/service/StoreWidgetApiService.java
View file @
4e436d02
...
...
@@ -3,6 +3,7 @@ package com.gic.store.service;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.store.dto.StoreBrandDTO
;
import
com.gic.store.dto.StoreColumnSet
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreWidgetDTO
;
...
...
@@ -86,4 +87,7 @@ public interface StoreWidgetApiService {
* @return result true表示存在
*/
ServiceResponse
existByStoreInfoId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
Integer
storeInfoId
);
ServiceResponse
<
StoreColumnSet
>
getStoreColumnSet
(
Integer
enterpriseId
,
Integer
storeWidgetId
);
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreGroupMapper.java
View file @
4e436d02
package
com
.
gic
.
store
.
dao
.
mapper
;
import
com.gic.store.entity.TabStoreGroup
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -127,5 +128,11 @@ public interface TabStoreGroupMapper {
*/
TabStoreGroup
selectUnGroupedStore
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
List
<
TabStoreGroup
>
listStoreGroupByIds
(
@Param
(
"storeGroupIdList"
)
List
<
Integer
>
storeGroupIdList
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
List
<
TabStoreGroup
>
listStoreGroupByIds
(
@Param
(
"storeGroupIdList"
)
List
<
Integer
>
storeGroupIdList
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"level"
)
Integer
level
);
Page
<
TabStoreGroup
>
pageStoreGroupByIds
(
@Param
(
"storeGroupIdList"
)
List
<
Integer
>
storeGroupIdList
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"parentId"
)
Integer
parentId
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/StoreGroupService.java
View file @
4e436d02
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.gic.store.dto.StoreGroupDTO
;
import
com.gic.store.entity.TabStoreGroup
;
import
com.github.pagehelper.Page
;
/**
* 门店分组
...
...
@@ -193,5 +194,7 @@ public interface StoreGroupService {
*/
TabStoreGroup
selectAllStoreGroup
(
Integer
enterpriseId
);
List
<
TabStoreGroup
>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
);
List
<
TabStoreGroup
>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
level
);
Page
<
TabStoreGroup
>
pageStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
parentId
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/StoreGroupServiceImpl.java
View file @
4e436d02
...
...
@@ -6,6 +6,7 @@ import com.gic.store.dao.mapper.TabStoreGroupMapper;
import
com.gic.store.dto.StoreGroupDTO
;
import
com.gic.store.entity.TabStoreGroup
;
import
com.gic.store.service.StoreGroupService
;
import
com.github.pagehelper.Page
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -159,8 +160,13 @@ public class StoreGroupServiceImpl implements StoreGroupService{
}
@Override
public
List
<
TabStoreGroup
>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
)
{
return
this
.
tabStoreGroupMapper
.
listStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
);
public
List
<
TabStoreGroup
>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
level
)
{
return
this
.
tabStoreGroupMapper
.
listStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
,
level
);
}
@Override
public
Page
<
TabStoreGroup
>
pageStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
parentId
){
return
this
.
tabStoreGroupMapper
.
pageStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
,
parentId
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreGroupApiServiceImpl.java
View file @
4e436d02
...
...
@@ -7,7 +7,10 @@ import java.util.Stack;
import
java.util.concurrent.TimeUnit
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.store.service.StoreApiService
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -351,10 +354,25 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
@Override
public
ServiceResponse
<
List
<
StoreGroupDTO
>>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
)
{
List
<
TabStoreGroup
>
list
=
this
.
storeGroupService
.
listStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
);
List
<
TabStoreGroup
>
list
=
this
.
storeGroupService
.
listStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
,
null
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreGroupDTO
.
class
,
list
));
}
@Override
public
ServiceResponse
<
List
<
StoreGroupDTO
>>
listStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
level
)
{
List
<
TabStoreGroup
>
list
=
this
.
storeGroupService
.
listStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
,
level
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreGroupDTO
.
class
,
list
));
}
@Override
public
ServiceResponse
<
Page
<
StoreGroupDTO
>>
pageStoreGroupByIds
(
List
<
Integer
>
storeGroupIdList
,
Integer
enterpriseId
,
Integer
parentId
,
Integer
pageSize
,
Integer
pageNum
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
com
.
github
.
pagehelper
.
Page
<
TabStoreGroup
>
tabStoreGroups
=
this
.
storeGroupService
.
pageStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
,
parentId
);
Page
<
StoreGroupDTO
>
storeGroupDTOPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
tabStoreGroups
,
StoreGroupDTO
.
class
);
return
ServiceResponse
.
success
(
storeGroupDTOPage
);
}
/**
* 刷新缓存,删除缓存
* @param storeGroupId
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreWidgetApiServiceImpl.java
View file @
4e436d02
...
...
@@ -6,10 +6,7 @@ import com.gic.commons.util.EntityUtil;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreBrandDTO
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreSearchDTO
;
import
com.gic.store.dto.StoreWidgetDTO
;
import
com.gic.store.dto.*
;
import
com.gic.store.entity.TabStoreBrand
;
import
com.gic.store.service.StoreApiService
;
import
com.gic.store.service.StoreBrandService
;
...
...
@@ -232,6 +229,36 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
return
ServiceResponse
.
success
(
false
);
}
@Override
public
ServiceResponse
<
StoreColumnSet
>
getStoreColumnSet
(
Integer
enterpriseId
,
Integer
storeWidgetId
)
{
StoreColumnSet
storeColumnSet
=
new
StoreColumnSet
();
this
.
getStoreColumnSet
(
enterpriseId
,
storeWidgetId
,
1
,
storeColumnSet
);
return
ServiceResponse
.
success
(
storeColumnSet
);
}
private
void
getStoreColumnSet
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
StoreColumnSet
storeColumnSet
){
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
listStoreByStoreWidgetId
(
enterpriseId
,
storeWidgetId
,
pageNum
,
10000
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
Page
<
StoreDTO
>
page
=
response
.
getResult
();
List
<
StoreDTO
>
result
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
result
)){
for
(
StoreDTO
storeDTO
:
result
){
storeColumnSet
.
getErpStatus
().
add
(
storeDTO
.
getErpStatus
());
storeColumnSet
.
getRegion
().
add
(
storeDTO
.
getRegionId
());
storeColumnSet
.
getStatus
().
add
(
storeDTO
.
getStatus
());
storeColumnSet
.
getStoreGroupId
().
addAll
(
storeDTO
.
getStoreGroupIdList
());
storeColumnSet
.
getStoreType
().
add
(
storeDTO
.
getStoreType
());
}
}
if
(
pageNum
==
1
&&
page
.
getPages
()
>
1
){
for
(
int
i
=
2
;
i
<=
page
.
getPages
();
i
++){
this
.
getStoreColumnSet
(
enterpriseId
,
storeWidgetId
,
i
,
storeColumnSet
);
}
}
}
}
private
void
getStoreId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
List
<
Integer
>
list
){
ServiceResponse
<
Page
<
Integer
>>
response
=
this
.
listStoreIdByStoreWidgetId
(
enterpriseId
,
storeWidgetId
,
pageNum
,
10000
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
...
...
gic-store-service/src/main/resources/mapper/TabStoreGroupMapper.xml
View file @
4e436d02
...
...
@@ -272,5 +272,23 @@
#{item}
</foreach>
</if>
<if
test=
"level != null"
>
and group_level = #{level}
</if>
</select>
<select
id=
"pageStoreGroupByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from
tab_store_group where status = 1 and enterprise_id = #{enterpriseId}
<if
test=
"null != storeGroupIdList and storeGroupIdList.size() > 0"
>
and store_group_id in
<foreach
collection=
"storeGroupIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"parentId != null"
>
and parent_store_group_id = #{parentId}
</if>
</select>
</mapper>
\ 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