Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
a17d9005
Commit
a17d9005
authored
Aug 04, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签同步-更新门店名称
parent
0afda885
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
0 deletions
+65
-0
TabHaobanStoreRelationMapper.java
...nage/service/dao/mapper/TabHaobanStoreRelationMapper.java
+9
-0
StoreSyncPojo.java
...ava/com/gic/haoban/manage/service/pojo/StoreSyncPojo.java
+21
-0
StoreRangeService.java
.../gic/haoban/manage/service/service/StoreRangeService.java
+8
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+5
-0
KafkaMessageServiceImpl.java
...c/haoban/manage/service/task/KafkaMessageServiceImpl.java
+11
-0
TabHaobanStoreRelationMapper.xml
...rc/main/resources/mapper/TabHaobanStoreRelationMapper.xml
+11
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStoreRelationMapper.java
View file @
a17d9005
...
...
@@ -80,4 +80,12 @@ public interface TabHaobanStoreRelationMapper {
* @return
*/
List
<
String
>
listStoreIdByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 更新门店名称
*
* @param enterpriseId
* @return
*/
public
int
updateStoreName
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"storeName"
)
String
storeName
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/StoreSyncPojo.java
View file @
a17d9005
...
...
@@ -23,10 +23,31 @@ public class StoreSyncPojo extends BinlogBasePojo {
@JSONField
(
name
=
"enterprise_id"
)
private
String
enterpriseId
;
@JSONField
(
name
=
"store_name"
)
private
String
storeName
;
private
String
oldStoreName
;
private
Integer
status
;
private
Integer
oldStatus
;
public
String
getStoreName
()
{
return
storeName
;
}
public
void
setStoreName
(
String
storeName
)
{
this
.
storeName
=
storeName
;
}
public
String
getOldStoreName
()
{
return
oldStoreName
;
}
public
void
setOldStoreName
(
String
oldStoreName
)
{
this
.
oldStoreName
=
oldStoreName
;
}
public
String
getOldStoreGroupId
()
{
return
oldStoreGroupId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StoreRangeService.java
View file @
a17d9005
...
...
@@ -96,5 +96,13 @@ public interface StoreRangeService {
*/
public
List
<
String
>
listStoreIdByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 更新门店名称
*
* @param enterpriseId
* @param storeId
* @param storeName
*/
public
void
updatwStoreName
(
String
enterpriseId
,
String
storeId
,
String
storeName
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
a17d9005
...
...
@@ -262,4 +262,9 @@ public class StoreRangeServiceImpl implements StoreRangeService {
public
List
<
String
>
listStoreIdByWxEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
return
tabHaobanStoreRelationMapper
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
}
@Override
public
void
updatwStoreName
(
String
enterpriseId
,
String
storeId
,
String
storeName
)
{
tabHaobanStoreRelationMapper
.
updateStoreName
(
enterpriseId
,
storeId
,
storeName
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/KafkaMessageServiceImpl.java
View file @
a17d9005
...
...
@@ -207,6 +207,10 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
&&
recordType
.
equals
(
GicRecordType
.
UPDATE
)
&&
!
mid
.
containsKey
(
"oldStoreGroupId"
))
{
mid
.
put
(
"oldStoreGroupId"
,
gicField
.
getValue
());
}
else
if
(
gicField
.
getName
().
equals
(
"store_name"
)
&&
recordType
.
equals
(
GicRecordType
.
UPDATE
)
&&
!
mid
.
containsKey
(
"oldStoreName"
))
{
mid
.
put
(
"oldStoreName"
,
gicField
.
getValue
());
}
else
{
mid
.
put
(
gicField
.
getName
(),
gicField
.
getValue
());
}
...
...
@@ -223,6 +227,13 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
* @param syncPojo
*/
private
void
dealStore
(
StoreSyncPojo
syncPojo
)
{
if
(
syncPojo
.
getRecordType
()
==
GicRecordType
.
UPDATE
.
value
()
&&
(!
syncPojo
.
getStoreName
().
equals
(
syncPojo
.
getOldStoreName
())))
{
logger
.
info
(
"门店名称变更:{}"
,
JSONObject
.
toJSONString
(
syncPojo
));
storeRangeService
.
updatwStoreName
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getStoreId
(),
syncPojo
.
getStoreName
());
}
//门店状态变更 包括删除
if
(
syncPojo
.
getRecordType
()
==
GicRecordType
.
UPDATE
.
value
()
&&
(!
syncPojo
.
getStatus
().
equals
(
syncPojo
.
getOldStatus
())))
{
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStoreRelationMapper.xml
View file @
a17d9005
...
...
@@ -208,4 +208,14 @@
</foreach>
and status_flag=1
</update>
<update
id=
"updateStoreName"
>
update tab_haoban_store_relation
set
store_name = #{storeName},
update_time = now()
where enterprise_id=#{enterpriseId}
and store_id=#{storeId}
and status_flag=1
</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