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
40a43d14
Commit
40a43d14
authored
Jan 14, 2021
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增店长
parent
c673f517
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
pom.xml
haoban-manage3-service/pom.xml
+6
-0
KafkaMessageServiceImpl.java
...c/haoban/manage/service/task/KafkaMessageServiceImpl.java
+32
-0
No files found.
haoban-manage3-service/pom.xml
View file @
40a43d14
...
...
@@ -72,6 +72,12 @@
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-task-api
</artifactId>
<version>
${haoban-task-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-contacts-api
</artifactId>
<version>
${haoban-contacts-api}
</version>
</dependency>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/KafkaMessageServiceImpl.java
View file @
40a43d14
...
...
@@ -4,7 +4,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.binlog.base.entity.GicField
;
import
com.gic.binlog.base.entity.GicRecord
;
import
com.gic.binlog.base.entity.enums.GicRecordType
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.contacts.manage.api.enums.StatusEnum
;
...
...
@@ -16,6 +19,11 @@ import com.gic.haoban.manage.service.pojo.BinlogBasePojo;
import
com.gic.haoban.manage.service.pojo.ClerkSyncPojo
;
import
com.gic.haoban.manage.service.service.StaffClerkBindLogService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.task.api.dto.MqMessageQo
;
import
com.gic.mq.sdk.exception.RouterException
;
import
com.gic.qcloud.cmq.CMQClientException
;
import
com.gic.qcloud.cmq.CMQServerException
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.kafka.clients.consumer.ConsumerRecord
;
...
...
@@ -48,6 +56,8 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
ClerkService
clerkService
;
@Override
...
...
@@ -65,6 +75,28 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
if
(
record
.
value
().
getTableName
().
equals
(
CLERK
))
{
dealClerk
((
ClerkSyncPojo
)
pojo
);
//TODO 发消息处理新增店长,任务重新分配问题
ClerkSyncPojo
syncPojo
=
(
ClerkSyncPojo
)
pojo
;
GicRecordType
gicRecordType
=
GicRecordType
.
valueOf
(
syncPojo
.
getRecordType
());
if
(
gicRecordType
.
equals
(
GicRecordType
.
INSERT
)){
//新增店长
String
clerkId
=
syncPojo
.
getClerkId
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
Integer
clerkType
=
clerkDTO
.
getClerkType
();
if
(
clerkType
!=
null
&&
clerkType
.
intValue
()
==
1
){
//TODO 发消息处理新增店长,任务重新分配问题
try
{
MqMessageQo
mqMessageQo
=
new
MqMessageQo
();
mqMessageQo
.
setType
(
MqMessageQo
.
DISTRIBUTE_TASK
);
mqMessageQo
.
setData
(
clerkId
);
String
s
=
JSONObject
.
toJSONString
(
mqMessageQo
);
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
s
,
"com.gic.haoban.task.api.service.MqAsynApiService"
,
"run"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
...
...
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