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
2c475469
Commit
2c475469
authored
Jul 05, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfix/好办mq拆分'
parents
02eaee7a
6f23fbff
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
197 additions
and
16 deletions
+197
-16
DealSyncOperationApiService.java
...aoban/manage/api/service/DealSyncOperationApiService.java
+8
-0
WxUserAddLogServiceImpl.java
...nage/service/service/hm/impl/WxUserAddLogServiceImpl.java
+6
-1
WelcomeSendServiceImpl.java
...n/manage/service/service/impl/WelcomeSendServiceImpl.java
+2
-0
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+39
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+23
-5
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+7
-0
QywxDeptSyncOperation.java
...gic/haoban/manage/service/task/QywxDeptSyncOperation.java
+1
-1
SelfFriendSyncNewOperation.java
...anage/service/task/friend/SelfFriendSyncNewOperation.java
+1
-1
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+1
-1
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+22
-7
StaffExportVO.java
...main/java/com/gic/haoban/manage/web/vo/StaffExportVO.java
+81
-0
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+6
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DealSyncOperationApiService.java
View file @
2c475469
...
...
@@ -23,6 +23,14 @@ public interface DealSyncOperationApiService {
* @param params
*/
void
departmentDealMq
(
String
params
);
/**
* mq拆分
* 部门同步处理
* "routerName": "departmentSyncDealMq2"
*
* @param params
*/
void
departmentDealMq2
(
String
params
);
/**
* 处理前端数据
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/WxUserAddLogServiceImpl.java
View file @
2c475469
...
...
@@ -63,7 +63,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
entity
.
setAddChannel
(
0
);
entity
.
setStatusFlag
(
1
);
entity
.
setStaffId
(
qdto
.
getStaffId
());
entity
.
setStaffName
(
qdto
.
getStaffName
());
//截取成员name
String
staffName
=
qdto
.
getStaffName
();
if
(
null
!=
staffName
&&
staffName
.
length
()>
32
){
staffName
=
staffName
.
substring
(
0
,
32
);
}
entity
.
setStaffName
(
staffName
);
entity
.
setAllDelFlag
(
0
);
if
(
qdto
.
isDelFlag
())
{
TabWxUserAddLog
logUser
=
this
.
wxUserAddLogMapper
.
selectNewLog
(
externalUserid
,
qdto
.
getStaffId
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WelcomeSendServiceImpl.java
View file @
2c475469
...
...
@@ -158,7 +158,9 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
String
content
=
welcomeBO
.
getWelcomeContent
();
if
(
content
.
contains
(
"<微信昵称>"
))
{
String
nickName
=
this
.
getExternalUserName
(
qwDTO
,
externalUserId
);
nickName
=
nickName
.
replaceAll
(
"\\$"
,
"RDS_CHAR_DOLLAR"
);
// encode replacement;
content
=
content
.
replaceAll
(
"<微信昵称>"
,
nickName
);
content
=
content
.
replaceAll
(
"RDS_CHAR_DOLLAR"
,
"\\$"
);
// decode replacement;
}
QywxWelcomeMsgDTO
qywxWelcomeMsgDTO
=
new
QywxWelcomeMsgDTO
();
// 欢迎语内容
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
2c475469
...
...
@@ -133,6 +133,45 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
}
}
@Override
public
void
departmentDealMq2
(
String
params
)
{
DealParamMqDTO
dealParamMqDTO
=
JSONObject
.
parseObject
(
params
,
DealParamMqDTO
.
class
);
TabHaobanPreDealLog
dataPre
=
preDealService
.
getByDataId
(
dealParamMqDTO
.
getTaskId
(),
dealParamMqDTO
.
getData
(),
dealParamMqDTO
.
getType
()
-
1
,
PreDealStatusEnum
.
all
.
getVal
());
logger
.
info
(
"好办同步处理mq处理开始:{},dataPre={}"
,
params
,
JSON
.
toJSONString
(
dataPre
));
if
(
dataPre
==
null
)
{
return
;
}
Integer
dataType
=
dataPre
.
getDataType
();
logger
.
info
(
"同步类型,dataType:{}"
,
dataType
);
if
(
dataType
.
equals
(
PreDealTypeEnum
.
dept
.
getVal
()))
{
logger
.
info
(
"0 部门处理:{}"
,
params
);
operationMap
.
get
(
"qywxDeptSyncOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
clerk
.
getVal
()))
{
logger
.
info
(
"2 成员处理:{}"
,
params
);
operationMap
.
get
(
"qywxStaffSyncOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
friend_clerk
.
getVal
()))
{
logger
.
info
(
"6 好友导购处理:{}"
,
params
);
operationMap
.
get
(
"friendClerkSyncNewOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
friend
.
getVal
()))
{
logger
.
info
(
"8 第三方好友处理:{}"
,
params
);
operationMap
.
get
(
"friendSyncNewOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
self_friend
.
getVal
()))
{
logger
.
info
(
"7 自建好友处理:{}"
,
params
);
operationMap
.
get
(
"selfFriendSyncNewOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
tag
.
getVal
()))
{
logger
.
info
(
"10 会员标签处理:{}"
,
params
);
operationMap
.
get
(
"friendTagSyncOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
tag_member
.
getVal
()))
{
logger
.
info
(
"11 会员标签处理标签项:{}"
,
params
);
operationMap
.
get
(
"friendMemberTagSyncOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
if
(
dataType
.
equals
(
PreDealTypeEnum
.
modify_hm
.
getVal
()))
{
logger
.
info
(
"20 活码批量修改"
);
operationMap
.
get
(
"qwHmOperation"
).
dealSingleByMq
(
dealParamMqDTO
,
dataPre
);
}
else
{
logger
.
info
(
"不是正常数据类型:{}"
,
params
);
}
}
@Override
public
void
dealDepartment
(
String
taskId
,
String
wxEnterpriseId
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
2c475469
...
...
@@ -37,7 +37,6 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.errorcode.HaoBanErrCode
;
import
com.gic.haoban.manage.service.errorcode.QywxErrCode
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.service.*
;
...
...
@@ -55,6 +54,7 @@ import com.gic.wechat.api.service.qywx.QywxOrderApiService;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -283,11 +283,29 @@ public class StaffApiServiceImpl implements StaffApiService {
phoneNumber
=
arr
[
1
];
}
String
openUserid
=
getOpenUserid
(
wxUserId
,
dkCorpid
,
qwDTO
);
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
openUserid
,
wxEnterpriseId
);
if
(
staff
!=
null
)
{
staffService
.
delOtherStaffByWxUserId
(
staff
.
getWxUserId
(),
staff
.
getStaffId
(),
wxEnterpriseId
);
TabHaobanStaff
staff
=
new
TabHaobanStaff
();
List
<
StaffDTO
>
staffDTOList
=
staffService
.
listByUserIdsAndWxEnterpriseId
(
Lists
.
newArrayList
(
wxUserId
,
openUserid
),
wxEnterpriseId
);
if
(
CollUtil
.
isNotEmpty
(
staffDTOList
)
&&
staffDTOList
.
size
()>
1
)
{
//只保留一个staff
for
(
int
i
=
0
;
i
<
staffDTOList
.
size
()-
1
;
i
++){
StaffDTO
dto
=
staffDTOList
.
get
(
i
);
String
staffId
=
dto
.
getStaffId
();
// 员工解绑
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listByStaffId
(
wxEnterpriseId
,
staffId
);
if
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
))
{
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
staffClerkRelationDTOS
)
{
staffClerkRelationService
.
delBind
(
staffId
,
staffClerkRelationDTO
.
getClerkId
(),
ChannelCodeEnum
.
ADMIN_UNBIND
.
getCode
(),
null
,
wxEnterpriseId
);
}
}
this
.
staffService
.
delByStaffId
(
staffId
);
staffDTOList
.
remove
(
i
);
}
}
if
(
CollUtil
.
isNotEmpty
(
staffDTOList
)){
staff
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
staffDTOList
.
get
(
0
)),
TabHaobanStaff
.
class
);
}
staff
=
(
staff
==
null
?
new
TabHaobanStaff
()
:
staff
);
staff
.
setWxUserId
(
wxUserId
);
if
(
StringUtils
.
isNotBlank
(
openUserid
))
{
staff
.
setWxOpenUseId
(
openUserid
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
2c475469
...
...
@@ -170,12 +170,19 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public
ServiceResponse
bindStaffClerk
(
StaffClerkRelationDTO
staffClerkRelationDTO
,
String
optStaffId
,
int
channelCode
)
{
//加锁防止并发问题
String
clerkId
=
staffClerkRelationDTO
.
getClerkId
();
String
storeId
=
staffClerkRelationDTO
.
getStoreId
();
String
key
=
"haoban_bind_staff:"
+
clerkId
+
":"
+
storeId
;
RedisUtil
.
lock
(
key
,
6L
);
ServiceResponse
resp
=
this
.
bindCheck
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
);
if
(
resp
!=
null
&&
!
resp
.
isSuccess
())
{
logger
.
error
(
"不允许绑定:{}"
,
resp
.
getMessage
());
RedisUtil
.
unlock
(
key
);
return
resp
;
}
String
relationId
=
staffClerkRelationService
.
bind
(
staffClerkRelationDTO
,
optStaffId
,
channelCode
);
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
relationId
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/QywxDeptSyncOperation.java
View file @
2c475469
...
...
@@ -260,7 +260,7 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
dealParamMqDTO
.
setType
(
syncTaskStatusEnum
.
getVal
());
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendMessage
(
"departmentSyncDealMq"
,
JSONObject
.
toJSONString
(
dealParamMqDTO
));
clientInstance
.
sendMessage
(
"departmentSyncDealMq
2
"
,
JSONObject
.
toJSONString
(
dealParamMqDTO
));
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送失败:{},{}"
,
taskId
,
relationId
);
e
.
printStackTrace
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/SelfFriendSyncNewOperation.java
View file @
2c475469
...
...
@@ -213,7 +213,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
Log
.
info
(
"发送队列SelfFriendSyncNewOperation={}"
,
JSON
.
toJSONString
(
ret
));
clientInstance
.
sendBatchMessages
(
"departmentSyncDealMq"
,
ret
);
clientInstance
.
sendBatchMessages
(
"departmentSyncDealMq
2
"
,
ret
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送失败:{},{}"
,
taskId
);
e
.
printStackTrace
();
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
2c475469
...
...
@@ -144,7 +144,7 @@
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_audit
where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and status_flag = 1
<if
test=
"auditType != null"
>
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
2c475469
...
...
@@ -527,6 +527,11 @@ public class StaffController extends WebBaseController {
vo
.
setPosition
(
staffDTO
.
getPostion
());
vo
.
setDepartmentName
(
departmentMap
.
get
(
staffDTO
.
getDepartmentIds
())
==
null
?
null
:
departmentMap
.
get
(
staffDTO
.
getDepartmentIds
()).
getDepartmentName
());
vo
.
setRelationFlag
((
Objects
.
isNull
(
staffDTO
.
getRelationFlag
())
||
staffDTO
.
getRelationFlag
()
==
0
)
?
"未关联"
:
"已关联"
);
vo
.
setWxUserId
(
staffDTO
.
getWxUserId
());
vo
.
setWxOpenUseId
(
staffDTO
.
getWxOpenUseId
());
vo
.
setActiveTime
(
staffDTO
.
getActiveTime
()
==
null
?
null
:
DateUtil
.
dateToStr
(
staffDTO
.
getActiveTime
(),
DateUtil
.
FORMAT_DATETIME_19
));
vo
.
setExpireTime
(
staffDTO
.
getExpireTime
()
==
null
?
null
:
DateUtil
.
dateToStr
(
staffDTO
.
getExpireTime
(),
DateUtil
.
FORMAT_DATETIME_19
));
vo
.
setPermitState
(
staffDTO
.
getPermitState
());
if
(
flag
){
List
<
String
>
enterpriseNameList
=
staffDTO
.
getEnterpriseNameList
();
if
(
CollUtil
.
isNotEmpty
(
enterpriseNameList
)){
...
...
@@ -546,14 +551,24 @@ public class StaffController extends WebBaseController {
}
mergeClerkInfo
(
voList
,
wxEnterpriseId
);
String
fileName
=
wxEnterpriseName
+
"通讯录"
+
DateUtil
.
dateToStr
(
new
Date
(),
DateUtil
.
FORMAT_DATE_8
);
List
<
String
>
titleList
=
new
ArrayList
<>(
);
List
<
String
>
fileList
=
new
ArrayList
<>(
);
List
<
String
>
titleList
=
Lists
.
newArrayList
(
"姓名"
,
"职务"
,
"部门"
,
"手机号"
,
"关联状态"
,
"关联导购"
);
List
<
String
>
fileList
=
Lists
.
newArrayList
(
"staffName"
,
"position"
,
"departmentName"
,
"phoneNumber"
,
"relationFlag"
,
"clerkName"
);
if
(
flag
){
titleList
=
Arrays
.
asList
(
"姓名"
,
"职务"
,
"部门"
,
"手机号"
,
"关联状态"
,
"关联导购"
,
"所属商户"
);
fileList
=
Arrays
.
asList
(
"staffName"
,
"position"
,
"departmentName"
,
"phoneNumber"
,
"relationFlag"
,
"clerkName"
,
"enterpriseName"
);
}
else
{
titleList
=
Arrays
.
asList
(
"姓名"
,
"职务"
,
"部门"
,
"手机号"
,
"关联状态"
,
"关联导购"
);
fileList
=
Arrays
.
asList
(
"staffName"
,
"position"
,
"departmentName"
,
"phoneNumber"
,
"relationFlag"
,
"clerkName"
);
titleList
.
add
(
"所属商户"
);
fileList
.
add
(
"enterpriseName"
);
}
//针对未升级好办独立应用的企业,导出表格增加导出字段:成员明文userid、成员加密userid、许可状态、许可激活时间、许可到期时间
if
(
enterprise
!=
null
&&
enterprise
.
getWxSecurityType
()
!=
5
){
titleList
.
add
(
"成员明文userid"
);
titleList
.
add
(
"成员加密userid"
);
titleList
.
add
(
"许可状态"
);
titleList
.
add
(
"许可激活时间"
);
titleList
.
add
(
"许可到期时间"
);
fileList
.
add
(
"wxUserId"
);
fileList
.
add
(
"wxOpenUseId"
);
fileList
.
add
(
"status"
);
fileList
.
add
(
"activeTime"
);
fileList
.
add
(
"expireTime"
);
}
try
{
ExcelUtils
.
xls
(
response
,
request
,
fileName
,
voList
,
fileList
,
titleList
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/StaffExportVO.java
View file @
2c475469
...
...
@@ -31,6 +31,87 @@ public class StaffExportVO implements Serializable{
* gic品牌名称
*/
private
String
enterpriseName
;
/**
* 微信用户id
*/
private
String
wxUserId
;
/**
* 微信用户加密id
*/
private
String
wxOpenUseId
;
/**
* 许可激活时间
*/
private
String
activeTime
;
/**
* 许可过期时间
*/
private
String
expireTime
;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期
*/
private
Integer
permitState
;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期
*/
private
String
status
;
public
Integer
getPermitState
()
{
return
permitState
;
}
public
void
setPermitState
(
Integer
permitState
)
{
this
.
permitState
=
permitState
;
}
public
String
getStatus
()
{
if
(
this
.
permitState
==
0
){
status
=
"未激活"
;
}
else
if
(
this
.
permitState
==
1
){
status
=
"正常有效"
;
}
else
if
(
this
.
permitState
==
2
){
status
=
"即将过期"
;
}
else
if
(
this
.
permitState
==
3
){
status
=
"已过期"
;
}
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
public
String
getWxOpenUseId
()
{
return
wxOpenUseId
;
}
public
void
setWxOpenUseId
(
String
wxOpenUseId
)
{
this
.
wxOpenUseId
=
wxOpenUseId
;
}
public
String
getActiveTime
()
{
return
activeTime
;
}
public
void
setActiveTime
(
String
activeTime
)
{
this
.
activeTime
=
activeTime
;
}
public
String
getExpireTime
()
{
return
expireTime
;
}
public
void
setExpireTime
(
String
expireTime
)
{
this
.
expireTime
=
expireTime
;
}
public
String
getEnterpriseName
()
{
return
enterpriseName
;
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
2c475469
...
...
@@ -922,8 +922,14 @@ public class WxStaffController extends WebBaseController {
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_BIND
.
getCode
(),
wxEnterpriseId
,
clerk
.
getEnterpriseId
());
if
(
auditDTO
!=
null
)
{
// 验证码登录不需要管理员审核,需要删除该记录
if
(
auditType
==
2
){
auditDTO
.
setStatusFlag
(
0
);
auditApiService
.
update
(
auditDTO
);
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
}
}
String
storeId
=
""
;
String
storeName
=
""
;
if
(
manageFlag
!=
null
&&
manageFlag
==
1
)
{
...
...
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