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
c90409ed
Commit
c90409ed
authored
Apr 02, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
05646667
791d69e9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
79 deletions
+55
-79
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+10
-34
TabStoreMapper.java
...rc/main/java/com/gic/store/dao/mapper/TabStoreMapper.java
+5
-0
StoreService.java
...ice/src/main/java/com/gic/store/service/StoreService.java
+4
-0
StoreServiceImpl.java
...ain/java/com/gic/store/service/impl/StoreServiceImpl.java
+10
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+10
-45
StoreGroupApiServiceImpl.java
...ic/store/service/outer/impl/StoreGroupApiServiceImpl.java
+4
-0
TabStoreMapper.xml
...tore-service/src/main/resources/mapper/TabStoreMapper.xml
+12
-0
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
c90409ed
...
...
@@ -167,7 +167,16 @@ public interface StoreApiService {
* @return com.gic.api.base.commons.ServiceResponse
* @throws
*/
ServiceResponse
<
Void
>
bulkAddStoreToIndex
(
Integer
enterpriseId
);
ServiceResponse
<
Integer
>
bulkAddStoreToIndex
(
Integer
enterpriseId
);
/** @Description: 通过分组刷新门店缓存
* @author taogs
* @Date 14:25 2020/4/2
* @Param
* @return
*/
ServiceResponse
<
Integer
>
refreshStoreIndex
(
Integer
enterpriseId
,
Integer
storeGroupId
);
/**
* @Title: bulkAddStoreToIndex
...
...
@@ -181,39 +190,6 @@ public interface StoreApiService {
ServiceResponse
<
Void
>
bulkAddStoreToIndex
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
);
/**
* @Title: updateStoreToIndex
* @Description: 批量编辑门店到索引
* @author zhiwj
* @param enterpriseId
* @param storeId
* @param indexId
* @return com.gic.api.base.commons.ServiceResponse
* @throws
*/
ServiceResponse
<
Void
>
updateStoreToIndex
(
Integer
enterpriseId
,
Integer
storeId
,
Long
indexId
);
/**
* @Title: bulkUpdateStoreToIndex
* @Description: 批量编辑门店到索引
* @author zhiwj
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse
* @throws
*/
ServiceResponse
<
Void
>
bulkUpdateStoreToIndex
(
Integer
enterpriseId
);
/**
* @Title: bulkUpdateStoreToIndex
* @Description: 批量编辑门店到索引
* @author zhiwj
* @param enterpriseId
* @param storeIdList
* @return com.gic.api.base.commons.ServiceResponse
* @throws
*/
ServiceResponse
<
Void
>
bulkUpdateStoreToIndex
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
);
/**
* @Title: queryStoreFromES
* @Description: 查询es
* @author zhiwj
...
...
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreMapper.java
View file @
c90409ed
...
...
@@ -77,4 +77,8 @@ public interface TabStoreMapper {
@Param
(
"storeBrandId"
)
Integer
storeBrandId
);
Integer
checkExistStore
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
int
refreshStoreIndex
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
int
refreshStoreIndexByStoreGroup
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"storeGroupId"
)
Integer
storeGroupId
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/StoreService.java
View file @
c90409ed
...
...
@@ -130,4 +130,8 @@ public interface StoreService {
TabStore
getByStoreCodeAndRegionId
(
Integer
enterpriseId
,
Integer
regionId
,
String
storeCode
);
Boolean
checkExistStore
(
Integer
enterpriseId
);
int
refreshStoreIndex
(
Integer
enterpriseId
);
int
refreshStoreIndex
(
Integer
enterpriseId
,
Integer
storeGroupId
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/StoreServiceImpl.java
View file @
c90409ed
...
...
@@ -514,4 +514,14 @@ public class StoreServiceImpl implements StoreService {
Integer
line
=
this
.
tabStoreMapper
.
checkExistStore
(
enterpriseId
);
return
line
!=
null
;
}
@Override
public
int
refreshStoreIndex
(
Integer
enterpriseId
)
{
return
this
.
tabStoreMapper
.
refreshStoreIndex
(
enterpriseId
);
}
@Override
public
int
refreshStoreIndex
(
Integer
enterpriseId
,
Integer
storeGroupId
)
{
return
this
.
tabStoreMapper
.
refreshStoreIndexByStoreGroup
(
enterpriseId
,
storeGroupId
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
c90409ed
...
...
@@ -1042,9 +1042,9 @@ public class StoreApiServiceImpl implements StoreApiService {
}
if
(
type
==
1
||
type
==
5
||
type
==
7
)
{
if
(
"all"
.
equals
(
storeIds
))
{
this
.
bulk
Update
StoreToIndex
(
enterpriseId
);
this
.
bulk
Add
StoreToIndex
(
enterpriseId
);
}
else
{
this
.
bulk
Update
StoreToIndex
(
enterpriseId
,
storeIdList
);
this
.
bulk
Add
StoreToIndex
(
enterpriseId
,
storeIdList
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -1130,55 +1130,20 @@ public class StoreApiServiceImpl implements StoreApiService {
@Override
public
ServiceResponse
bulkAddStoreToIndex
(
Integer
enterpriseId
)
{
List
<
Integer
>
storeIdList
=
this
.
storeService
.
listAllStoreId
(
enterpriseId
);
return
this
.
bulkAddStoreToIndex
(
enterpriseId
,
storeIdList
);
int
i
=
this
.
storeService
.
refreshStoreIndex
(
enterpriseId
);
return
ServiceResponse
.
success
(
i
);
}
@Override
public
ServiceResponse
bulkAddStoreToIndex
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
storeIdList
))
{
List
<
DynamicDocDTO
>
dynamicDocDTOList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
storeIdList
.
size
();
i
++)
{
DynamicDocDTO
docDTO
=
this
.
buildStoreDocDto
(
enterpriseId
,
storeIdList
.
get
(
i
));
dynamicDocDTOList
.
add
(
docDTO
);
if
(
dynamicDocDTOList
.
size
()
==
200
)
{
this
.
esBusinessOperaApiService
.
createDataBatch
(
dynamicDocDTOList
,
true
);
dynamicDocDTOList
.
clear
();
}
}
if
(
CollectionUtils
.
isNotEmpty
(
dynamicDocDTOList
))
{
this
.
esBusinessOperaApiService
.
createDataBatch
(
dynamicDocDTOList
,
true
);
}
}
return
ServiceResponse
.
success
();
public
ServiceResponse
<
Integer
>
refreshStoreIndex
(
Integer
enterpriseId
,
Integer
storeGroupId
)
{
int
i
=
this
.
storeService
.
refreshStoreIndex
(
enterpriseId
,
storeGroupId
);
return
ServiceResponse
.
success
(
i
);
}
@Override
public
ServiceResponse
updateStoreToIndex
(
Integer
enterpriseId
,
Integer
storeId
,
Long
indexId
)
{
return
null
;
}
@Override
public
ServiceResponse
bulkUpdateStoreToIndex
(
Integer
enterpriseId
)
{
List
<
Integer
>
storeIdList
=
this
.
storeService
.
listAllStoreId
(
enterpriseId
);
return
this
.
bulkUpdateStoreToIndex
(
enterpriseId
,
storeIdList
);
}
@Override
public
ServiceResponse
bulkUpdateStoreToIndex
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
storeIdList
))
{
List
<
DynamicDocDTO
>
dynamicDocDTOList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
storeIdList
.
size
();
i
++)
{
DynamicDocDTO
docDTO
=
this
.
buildStoreDocDto
(
enterpriseId
,
storeIdList
.
get
(
i
));
dynamicDocDTOList
.
add
(
docDTO
);
if
(
dynamicDocDTOList
.
size
()
==
200
)
{
this
.
esBusinessOperaApiService
.
updateDataBatch
(
dynamicDocDTOList
,
true
);
dynamicDocDTOList
.
clear
();
}
}
if
(
CollectionUtils
.
isNotEmpty
(
dynamicDocDTOList
))
{
this
.
esBusinessOperaApiService
.
updateDataBatch
(
dynamicDocDTOList
,
true
);
}
public
ServiceResponse
bulkAddStoreToIndex
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
)
{
for
(
Integer
storeId
:
storeIdList
){
this
.
addStoreToIndex
(
enterpriseId
,
storeId
);
}
return
ServiceResponse
.
success
();
}
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreGroupApiServiceImpl.java
View file @
c90409ed
...
...
@@ -6,6 +6,7 @@ import java.util.List;
import
java.util.Stack
;
import
java.util.concurrent.TimeUnit
;
import
com.gic.store.service.StoreApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -38,6 +39,8 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
private
StoreService
storeService
;
@Autowired
private
StoreGroupService
storeGroupService
;
@Autowired
private
StoreApiService
storeApiService
;
@Override
public
ServiceResponse
<
Integer
>
save
(
StoreGroupDTO
storeGroupDTO
)
{
...
...
@@ -204,6 +207,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
//刷新缓存
refreshRedisCache
(
storeGroupDTO
.
getStoreGroupId
());
this
.
storeApiService
.
refreshStoreIndex
(
storeGroupDTO
.
getEnterpriseId
(),
storeGroupDTO
.
getStoreGroupId
());
return
ServiceResponse
.
success
(
SUCCESS
);
}
...
...
gic-store-service/src/main/resources/mapper/TabStoreMapper.xml
View file @
c90409ed
...
...
@@ -238,4 +238,15 @@
from tab_store
where enterprise_id = #{enterpriseId} and own_type = 0 limit 1
</select>
<update
id=
"refreshStoreIndex"
>
update tab_store t1,tab_store_info t2 set t2.index_id=t2.index_id + 1,t2.update_time=t2.update_time
where t1.enterprise_id=#{enterpriseId}
and t1.store_info_id=t2.store_info_id
</update>
<update
id=
"refreshStoreIndexByStoreGroup"
>
update tab_store t1,tab_store_info t2 set t2.index_id=t2.index_id + 1,t2.update_time=t2.update_time
where t1.enterprise_id=#{enterpriseId}
and t1.store_group_id=#{storeGroupId}
and t1.store_info_id=t2.store_info_id
</update>
</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