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
c3da527a
Commit
c3da527a
authored
Jun 03, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步刷新好办成员信息
parent
7f34f175
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
4 deletions
+51
-4
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+3
-0
StaffClerkRelationService.java
...ban/manage/service/service/StaffClerkRelationService.java
+2
-0
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+5
-0
KafkaMessageServiceImpl.java
...c/haoban/manage/service/task/KafkaMessageServiceImpl.java
+30
-4
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+11
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
c3da527a
...
@@ -64,4 +64,6 @@ public interface TabHaobanStaffClerkRelationMapper {
...
@@ -64,4 +64,6 @@ public interface TabHaobanStaffClerkRelationMapper {
* 解绑
* 解绑
*/
*/
int
cleanStaffDepart
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"staffIds"
)
List
<
String
>
staffIds
);
int
cleanStaffDepart
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"staffIds"
)
List
<
String
>
staffIds
);
TabHaobanStaffClerkRelation
getOneBindCodeNoStatus
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkCode"
)
String
clerkCode
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffClerkRelationService.java
View file @
c3da527a
...
@@ -47,4 +47,6 @@ public interface StaffClerkRelationService {
...
@@ -47,4 +47,6 @@ public interface StaffClerkRelationService {
public
int
cleanStaffClerk
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
);
public
int
cleanStaffClerk
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
);
StaffClerkRelationDTO
getOneBindCodeNoStatus
(
String
enterpriseId
,
String
clerkCode
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
c3da527a
...
@@ -90,4 +90,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
...
@@ -90,4 +90,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public
int
cleanStaffClerk
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
)
{
public
int
cleanStaffClerk
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
)
{
return
mapper
.
cleanStaffDepart
(
wxEnterpriseId
,
staffIds
);
return
mapper
.
cleanStaffDepart
(
wxEnterpriseId
,
staffIds
);
}
}
@Override
public
StaffClerkRelationDTO
getOneBindCodeNoStatus
(
String
enterpriseId
,
String
clerkCode
)
{
return
EntityUtil
.
changeEntityByJSON
(
StaffClerkRelationDTO
.
class
,
mapper
.
getOneBindCodeNoStatus
(
enterpriseId
,
clerkCode
));
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/KafkaMessageServiceImpl.java
View file @
c3da527a
...
@@ -4,19 +4,20 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,19 +4,20 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.binlog.base.entity.GicField
;
import
com.gic.binlog.base.entity.GicField
;
import
com.gic.binlog.base.entity.GicRecord
;
import
com.gic.binlog.base.entity.GicRecord
;
import
com.gic.binlog.base.entity.enums.GicRecordType
;
import
com.gic.binlog.base.entity.enums.GicRecordType
;
import
com.gic.commons.util.BeanUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.contacts.manage.api.enums.StatusEnum
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.service.pojo.BinlogBasePojo
;
import
com.gic.haoban.manage.service.pojo.BinlogBasePojo
;
import
com.gic.haoban.manage.service.pojo.ClerkSyncPojo
;
import
com.gic.haoban.manage.service.pojo.ClerkSyncPojo
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
org.apache.commons.lang3.
String
Utils
;
import
org.apache.commons.lang3.
time.Date
Utils
;
import
org.apache.kafka.clients.consumer.ConsumerRecord
;
import
org.apache.kafka.clients.consumer.ConsumerRecord
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.kafka.listener.MessageListener
;
import
org.springframework.kafka.listener.MessageListener
;
import
java.util.
ArrayList
;
import
java.util.
Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -58,7 +59,32 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
...
@@ -58,7 +59,32 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
if
(
gicRecordType
.
equals
(
GicRecordType
.
DELETE
)){
if
(
gicRecordType
.
equals
(
GicRecordType
.
DELETE
)){
staffClerkRelationService
.
delBind
(
syncPojo
.
getClerkId
());
staffClerkRelationService
.
delBind
(
syncPojo
.
getClerkId
());
}
else
if
(
gicRecordType
.
equals
(
GicRecordType
.
INSERT
))
{
}
else
if
(
gicRecordType
.
equals
(
GicRecordType
.
INSERT
))
{
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getOneBindCodeNoStatus
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getClerkCode
());
if
(
null
==
relationDTO
)
{
logger
.
info
(
"没有关联导购,不需要新增"
);
return
;
}
//正常的时候
if
(
relationDTO
.
getStatusFlag
()
!=
StatusEnum
.
DEL
.
getValue
())
{
staffClerkRelationService
.
delBind
(
relationDTO
.
getClerkId
());
relationDTO
.
setClerkId
(
syncPojo
.
getClerkId
());
relationDTO
.
setStoreId
(
syncPojo
.
getStoreId
());
staffClerkRelationService
.
bind
(
relationDTO
);
}
else
{
//删除状态 需要判断是否近段时间有操作删除 2分组内有更新 判断是转移操作
Date
timeDiff
=
DateUtils
.
addMinutes
(
new
Date
(),
-
2
);
if
(
relationDTO
.
getUpdateTime
().
after
(
timeDiff
)){
staffClerkRelationService
.
delBind
(
relationDTO
.
getClerkId
());
relationDTO
.
setClerkId
(
syncPojo
.
getClerkId
());
relationDTO
.
setStoreId
(
syncPojo
.
getStoreId
());
staffClerkRelationService
.
bind
(
relationDTO
);
}
}
}
else
if
(
gicRecordType
.
equals
(
GicRecordType
.
UPDATE
))
{
StaffClerkRelationDTO
relationDTO
=
new
StaffClerkRelationDTO
();
relationDTO
.
setClerkId
(
syncPojo
.
getClerkId
());
relationDTO
.
setStoreId
(
syncPojo
.
getStoreId
());
relationDTO
.
setClerkCode
(
syncPojo
.
getClerkCode
());
staffClerkRelationService
.
updateByClerkId
(
relationDTO
);
}
}
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
c3da527a
...
@@ -274,4 +274,14 @@
...
@@ -274,4 +274,14 @@
#{item}
#{item}
</foreach>
</foreach>
</update>
</update>
<select
id=
"getOneBindCodeNoStatus"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and clerk_code = #{clerkCode}
order by update_time desc limit 1
</select>
</mapper>
</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