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
d7114257
Commit
d7114257
authored
Apr 02, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店保存修改
parent
1851bba5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
77 deletions
+49
-77
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
+8
-43
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 @
d7114257
...
...
@@ -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 @
d7114257
...
...
@@ -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 @
d7114257
...
...
@@ -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 @
d7114257
...
...
@@ -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 @
d7114257
...
...
@@ -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/resources/mapper/TabStoreMapper.xml
View file @
d7114257
...
...
@@ -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