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
b0dd8389
Commit
b0dd8389
authored
Feb 09, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店品牌变更
parent
4e636fe9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
7 deletions
+40
-7
TabStoreBrandRefMapper.java
...java/com/gic/store/dao/mapper/TabStoreBrandRefMapper.java
+12
-0
StoreBrandServiceImpl.java
...ava/com/gic/store/service/impl/StoreBrandServiceImpl.java
+10
-4
StoreAuthorizationApiServiceImpl.java
.../service/outer/impl/StoreAuthorizationApiServiceImpl.java
+4
-3
TabStoreBrandRefMapper.xml
...vice/src/main/resources/mapper/TabStoreBrandRefMapper.xml
+14
-0
No files found.
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreBrandRefMapper.java
View file @
b0dd8389
...
...
@@ -81,6 +81,18 @@ public interface TabStoreBrandRefMapper {
TabStoreBrandRef
selectByEidAndBrandId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"storeBrandId"
)
Integer
storeBrandId
);
/**
* selectByEidAndBrandIdList
* @Title: selectByEidAndBrandIdList
* @Description:
* @author taogs
* @param enterpriseId
* @param storeBrandIdList
* @return java.util.List<com.gic.store.entity.TabStoreBrandRef>
* @throws
*/
List
<
TabStoreBrandRef
>
selectByEidAndBrandIdList
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"storeBrandIdList"
)
List
<
Integer
>
storeBrandIdList
);
/**
* updateSort
* @Title: updateSort
* @Description: 更新排序
...
...
gic-store-service/src/main/java/com/gic/store/service/impl/StoreBrandServiceImpl.java
View file @
b0dd8389
...
...
@@ -17,10 +17,7 @@ import org.apache.logging.log4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -62,6 +59,10 @@ public class StoreBrandServiceImpl implements StoreBrandService {
@Override
public
void
saveStoreBrandRef
(
Integer
enterpriseId
,
Integer
storeBrandId
,
Integer
type
){
TabStoreBrandRef
existTab
=
tabStoreBrandRefMapper
.
selectByEidAndBrandId
(
enterpriseId
,
storeBrandId
);
if
(
existTab
!=
null
){
return
;
}
Date
date
=
new
Date
();
TabStoreBrandRef
tabStoreBrandRef
=
new
TabStoreBrandRef
();
Double
sort
=
tabStoreBrandRefMapper
.
getMinSort
(
enterpriseId
);
...
...
@@ -82,7 +83,12 @@ public class StoreBrandServiceImpl implements StoreBrandService {
Double
sort
=
tabStoreBrandRefMapper
.
getMinSort
(
enterpriseId
);
sort
=
sort
==
null
?
1
d
:
sort
-
1
d
;
Date
date
=
new
Date
();
List
<
TabStoreBrandRef
>
existList
=
tabStoreBrandRefMapper
.
selectByEidAndBrandIdList
(
enterpriseId
,
storeBrandIdList
);
Map
<
String
,
Integer
>
existMap
=
existList
.
stream
().
collect
(
Collectors
.
toMap
(
ref
->
ref
.
getEnterpriseId
()
+
"-"
+
ref
.
getStoreBrandId
(),
TabStoreBrandRef:
:
getId
));
for
(
Integer
storeBrandId
:
storeBrandIdList
){
if
(!
existMap
.
containsKey
(
enterpriseId
+
"-"
+
storeBrandId
)){
continue
;
}
TabStoreBrandRef
tabStoreBrandRef
=
new
TabStoreBrandRef
();
tabStoreBrandRef
.
setSort
(
sort
);
tabStoreBrandRef
.
setEnterpriseId
(
enterpriseId
);
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreAuthorizationApiServiceImpl.java
View file @
b0dd8389
...
...
@@ -143,6 +143,7 @@ public class StoreAuthorizationApiServiceImpl implements StoreAuthorizationApiSe
}
storeDTO
.
setIsEditStoreGroup
(
0
);
storeDTO
.
setOwnType
(
StoreOwnTypeEnum
.
OTHER
.
getCode
());
log
.
info
(
"授权门店信息:{}"
,
JSON
.
toJSONString
(
storeDTO
));
int
i
=
this
.
storeService
.
authAddStore
(
storeDTO
);
log
.
info
(
"{},门店授权结果:{}"
,
storeDTO
.
getStoreInfoId
(),
i
);
if
(
i
==
0
&&
logId
!=
0
){
...
...
@@ -173,7 +174,7 @@ public class StoreAuthorizationApiServiceImpl implements StoreAuthorizationApiSe
return
ServiceResponse
.
success
();
}
private
void
queryStoreByPage
(
Long
count
,
StoreSearchDTO
storeSearchDTO
,
Integer
toEnterpriseId
,
Integer
e
nterpriseId
,
String
key
){
private
void
queryStoreByPage
(
Long
count
,
StoreSearchDTO
storeSearchDTO
,
Integer
unionEnterpriseId
,
Integer
ownE
nterpriseId
,
String
key
){
int
pages
=
count
/
PAGE_SIZE
+
count
%
PAGE_SIZE
>
0
?
1
:
0
;
/**需要共享的域*/
Set
<
Integer
>
regionSet
=
new
HashSet
<>();
...
...
@@ -184,7 +185,7 @@ public class StoreAuthorizationApiServiceImpl implements StoreAuthorizationApiSe
/**需要共享的门店品牌****/
Set
<
Integer
>
storeBrandIdSet
=
new
HashSet
<>();
/**获取当前商户下的共享门店**/
List
<
Integer
>
existStoreInfoIdList
=
this
.
storeService
.
listShareStoreId
(
e
nterpriseId
);
List
<
Integer
>
existStoreInfoIdList
=
this
.
storeService
.
listShareStoreId
(
ownE
nterpriseId
);
Set
<
Integer
>
storeInfoIdSet
=
new
HashSet
<>(
existStoreInfoIdList
);
int
total
=
0
;
for
(
int
page
=
1
;
page
<=
pages
;
page
++){
...
...
@@ -207,7 +208,7 @@ public class StoreAuthorizationApiServiceImpl implements StoreAuthorizationApiSe
isEnd
=
1
;
}
total
++;
this
.
sendDataToMq
(
storeDTO
,
to
EnterpriseId
,
isEnd
,
key
,
total
);
this
.
sendDataToMq
(
storeDTO
,
union
EnterpriseId
,
isEnd
,
key
,
total
);
/**共享门店不能再共享 所以需要剔除***/
if
(
storeInfoIdSet
.
contains
(
storeDTO
.
getStoreInfoId
())){
storeInfoIdSet
.
remove
(
storeDTO
.
getStoreInfoId
());
...
...
gic-store-service/src/main/resources/mapper/TabStoreBrandRefMapper.xml
View file @
b0dd8389
...
...
@@ -140,6 +140,20 @@
where enterprise_id= #{enterpriseId} and store_brand_id=#{storeBrandId} and delete_flag = 0
</select>
<select
id=
"selectByEidAndBrandIdList"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_store_brand_ref
where enterprise_id= #{enterpriseId} and delete_flag = 0
<if
test=
"storeBrandIdList.size()>0"
>
and store_brand_id in
<foreach
close=
")"
collection=
"storeBrandIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
</select>
<update
id=
"updateSort"
>
update tab_store_brand_ref set sort = #{sort}
where enterprise_id=#{enterpriseId} and store_brand_id = #{storeBrandId} and delete_flag = 0
...
...
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