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
QianQiXiang
haoban-manage3.0
Commits
e064d6c7
Commit
e064d6c7
authored
Jun 03, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0.git
into developer
parents
c4ded71b
c5a8df19
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
109 additions
and
28 deletions
+109
-28
StaffClerkRelationApiService.java
...oban/manage/api/service/StaffClerkRelationApiService.java
+10
-0
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
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+27
-24
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+6
-0
KafkaMessageServiceImpl.java
...c/haoban/manage/service/task/KafkaMessageServiceImpl.java
+30
-4
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+11
-0
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+15
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffClerkRelationApiService.java
View file @
e064d6c7
...
@@ -37,6 +37,8 @@ public interface StaffClerkRelationApiService {
...
@@ -37,6 +37,8 @@ public interface StaffClerkRelationApiService {
* @return
* @return
*/
*/
String
delByStoreIdAndCode
(
String
storeId
,
String
clerkCode
);
String
delByStoreIdAndCode
(
String
storeId
,
String
clerkCode
);
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkIds
);
List
<
StaffClerkRelationDTO
>
listByClerkIds
(
List
<
String
>
clerkIds
);
...
@@ -48,4 +50,12 @@ public interface StaffClerkRelationApiService {
...
@@ -48,4 +50,12 @@ public interface StaffClerkRelationApiService {
*/
*/
List
<
StaffClerkRelationDTO
>
listByStoreId
(
String
storeId
);
List
<
StaffClerkRelationDTO
>
listByStoreId
(
String
storeId
);
/**
* 解绑
* @param staffId
* @param clerkId
* @return
*/
boolean
unbindByStaffAndClerkId
(
String
staffId
,
String
clerkId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
e064d6c7
...
@@ -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 @
e064d6c7
...
@@ -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 @
e064d6c7
...
@@ -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/service/out/impl/StaffApiServiceImpl.java
View file @
e064d6c7
...
@@ -320,33 +320,36 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -320,33 +320,36 @@ public class StaffApiServiceImpl implements StaffApiService {
return
res
;
return
res
;
}
}
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
);
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
);
staff
=
(
staff
==
null
?
new
TabHaobanStaff
():
staff
);
staff
.
setWxUserId
(
userId
);
staff
.
setUpdateTime
(
new
Date
());
staff
.
setStatusFlag
(
1
);
staff
.
setWxEnterpriseId
(
wxEnterpriseId
);
if
(
StringUtils
.
isNotBlank
(
user
.
getAvatar
())){
staff
.
setHeadImg
(
changeHeaderImageUrl
(
user
.
getAvatar
()));
}
staff
.
setPhoneNumber
(
user
.
getMobile
());
if
(
StringUtils
.
isNotBlank
(
user
.
getName
()))
{
user
.
setName
(
EmojiParser
.
removeAllEmojis
(
user
.
getName
()));
staff
.
setStaffName
((
user
.
getName
()));
}
if
(
StringUtils
.
isNotBlank
(
user
.
getAlias
()))
{
user
.
setAlias
(
EmojiParser
.
removeAllEmojis
(
user
.
getAlias
()));
staff
.
setNickName
((
user
.
getAlias
()));
}
staff
.
setNationCode
(
"86"
);
staff
.
setSex
(
user
.
getGender
()
==
null
?
1
:
Integer
.
parseInt
(
user
.
getGender
()));
staff
.
setActiveFlag
(
1
);
staff
.
setPostion
(
user
.
getPosition
());
staff
.
setExtendPostion
(
user
.
getExternal_position
());
//成员更改或更新
if
(
staff
==
null
)
{
if
(
staff
==
null
)
{
logger
.
info
(
"新增成员"
);
logger
.
info
(
"新增成员"
);
staff
=
new
TabHaobanStaff
();
staff
.
setWxUserId
(
userId
);
staff
.
setCreateTime
(
new
Date
());
staff
.
setUpdateTime
(
new
Date
());
staff
.
setStatusFlag
(
1
);
staff
.
setWxEnterpriseId
(
wxEnterpriseId
);
if
(
StringUtils
.
isNotBlank
(
user
.
getAvatar
())){
staff
.
setHeadImg
(
changeHeaderImageUrl
(
user
.
getAvatar
()));
}
staff
.
setPhoneNumber
(
user
.
getMobile
());
if
(
StringUtils
.
isNotBlank
(
user
.
getName
()))
{
user
.
setName
(
EmojiParser
.
removeAllEmojis
(
user
.
getName
()));
staff
.
setStaffName
((
user
.
getName
()));
}
if
(
StringUtils
.
isNotBlank
(
user
.
getAlias
()))
{
user
.
setAlias
(
EmojiParser
.
removeAllEmojis
(
user
.
getAlias
()));
staff
.
setNickName
((
user
.
getAlias
()));
}
staff
.
setNationCode
(
"86"
);
staff
.
setSex
(
user
.
getGender
()
==
null
?
1
:
Integer
.
parseInt
(
user
.
getGender
()));
staff
.
setActiveFlag
(
1
);
staff
.
setPostion
(
user
.
getPosition
());
staff
.
setExtendPostion
(
user
.
getExternal_position
());
staff
.
setActiveFlag
(
0
);
staff
.
setActiveFlag
(
0
);
String
staffId
=
staffService
.
add
(
staff
);
staff
.
setCreateTime
(
new
Date
());
staffService
.
add
(
staff
);
}
else
{
staffService
.
updateByPrimaryKey
(
staff
);
}
}
logger
.
info
(
"门店变更保存:{}"
,
JSONObject
.
toJSONString
(
user
));
logger
.
info
(
"门店变更保存:{}"
,
JSONObject
.
toJSONString
(
user
));
staffDepartChange
(
staff
,
wxEnterpriseId
,
user
);
staffDepartChange
(
staff
,
wxEnterpriseId
,
user
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
e064d6c7
...
@@ -145,4 +145,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
...
@@ -145,4 +145,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
List
<
StaffClerkRelationDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
StaffClerkRelationDTO
.
class
,
list
);
List
<
StaffClerkRelationDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
StaffClerkRelationDTO
.
class
,
list
);
return
result
;
return
result
;
}
}
@Override
public
boolean
unbindByStaffAndClerkId
(
String
staffId
,
String
clerkId
)
{
boolean
b
=
staffClerkRelatinService
.
delBind
(
clerkId
);
return
b
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/KafkaMessageServiceImpl.java
View file @
e064d6c7
...
@@ -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 @
e064d6c7
...
@@ -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
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
e064d6c7
...
@@ -285,6 +285,21 @@ public class StaffController extends WebBaseController{
...
@@ -285,6 +285,21 @@ public class StaffController extends WebBaseController{
}
}
/**
/**
* 成员关联关系接口
* @param staffId
* @return
*/
@RequestMapping
(
"del-clerk-relation"
)
public
HaobanResponse
delStaffClerkList
(
String
staffId
,
String
clerkId
){
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
if
(
staff
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
}
boolean
b
=
staffClerkRelationApiService
.
unbindByStaffAndClerkId
(
staffId
,
clerkId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
}
/**
* 成员关联关系搜索接口
* 成员关联关系搜索接口
* @param search
* @param search
* @return
* @return
...
...
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