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
21fcdd41
Commit
21fcdd41
authored
May 09, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定的消息发送
parent
8541bdd6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
6 deletions
+95
-6
StaffDepartmentRelatedApiService.java
.../manage/api/service/StaffDepartmentRelatedApiService.java
+1
-1
BindApiServiceImpl.java
...n/manage/service/service/out/impl/BindApiServiceImpl.java
+94
-5
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffDepartmentRelatedApiService.java
View file @
21fcdd41
...
...
@@ -33,7 +33,7 @@ public interface StaffDepartmentRelatedApiService {
String
getPageUrl
(
int
type
,
String
data
);
//发送消息,单人发送
boolean
sendSingleMessage
(
String
wxUser
Id
,
String
title
,
String
content
,
String
pageUrl
);
boolean
sendSingleMessage
(
String
clerk
Id
,
String
title
,
String
content
,
String
pageUrl
);
List
<
StaffDepartmentRelatedDTO
>
listByStaffIds
(
List
<
String
>
staffIds
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/BindApiServiceImpl.java
View file @
21fcdd41
...
...
@@ -9,6 +9,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.csp.sentinel.util.StringUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
...
...
@@ -16,6 +19,7 @@ import com.gic.enterprise.api.service.StoreService;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.enums.AppPageType
;
import
com.gic.haoban.manage.api.service.BindApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
...
...
@@ -39,7 +43,7 @@ public class BindApiServiceImpl implements BindApiService {
private
StoreService
storeService
;
@Autowired
private
DepartmentApiService
departmentApiService
;
@Transactional
@Override
public
void
clerkManagerTranfer
(
String
departmentId
,
String
fromClerkCode
,
...
...
@@ -92,12 +96,26 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO
.
setHeadImgUrl
(
StringUtils
.
isEmpty
(
staffDTO
.
getHeadImg
())?
""
:
staffDTO
.
getHeadImg
());
clerkService
.
updateClerk
(
clerkDTO
);
}
//消息推送
if
(
StringUtils
.
isNotEmpty
(
oldStaffDepartmentRelatedDTO
.
getClerkCode
())){
String
clerkId
=
list
.
get
(
0
).
getClerkId
();
String
storeName
=
departmentDTO
.
getDepartmentName
();
String
staffName
=
staffDTO
.
getStaffName
();
String
clerkCode
=
oldStaffDepartmentRelatedDTO
.
getClerkCode
();
String
content
=
"【"
+
staffName
+
"】:【"
+
storeName
+
"】"
+
staffName
+
"导购code:"
+
clerkCode
+
"已解绑,请重新分配会员!"
;
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
MEMBER_LIST
.
getCode
(),
data
);
staffDepartmentRelatedApiService
.
sendSingleMessage
(
clerkId
,
"分配会员通知"
,
content
,
pageUrl
);
}
logger
.
info
(
"===========================》888888888888888"
);
}
@Transactional
@Override
public
void
clerkUnbind
(
String
departmentId
,
String
fromClerkCode
,
String
toStaffId
,
String
manager
)
{
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectById
(
departmentId
);
StaffDepartmentRelatedDTO
staffDepartmentRelatedDTO
=
staffDepartmentRelatedApiService
.
getOneByStaffIdAndDepartmentId
(
toStaffId
,
departmentId
);
String
oldClerkCode
=
staffDepartmentRelatedDTO
.
getClerkCode
();
if
(
"1"
.
equals
(
manager
)){
...
...
@@ -116,11 +134,11 @@ public class BindApiServiceImpl implements BindApiService {
dto
.
setUpdateTime
(
new
Date
());
staffDepartmentRelatedApiService
.
updateById
(
dto
);
//更新gic数据
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectById
(
departmentId
);
String
storeId
=
departmentDTO
.
getRelatedId
();
List
<
String
>
clerkCodes
=
new
ArrayList
<>();
clerkCodes
.
add
(
fromClerkCode
);
List
<
ClerkDTO
>
list
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
String
clerkName
=
CollectionUtil
.
isEmpty
(
list
)?
null
:
list
.
get
(
0
).
getClerkName
();
//获取姓名,发消息用
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
toStaffId
);
for
(
ClerkDTO
clerkDTO
:
list
){
clerkDTO
.
setPhoneNumber
(
staffDTO
.
getPhoneNumber
());
...
...
@@ -138,6 +156,24 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
//发送消息
if
(
StringUtil
.
isNotBlank
(
fromClerkCode
)){
//发送消息
ClerkDTO
leader
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
String
clerkId
=
leader
.
getClerkId
();
String
storeName
=
departmentDTO
.
getDepartmentName
();
String
staffName
=
clerkName
;
String
leaderName
=
leader
.
getClerkName
();
String
clerkCode
=
fromClerkCode
;
String
content
=
"【"
+
leaderName
+
"】:【"
+
storeName
+
"】"
+
staffName
+
"导购code:"
+
clerkCode
+
"已解绑,请重新分配会员!"
;
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
MEMBER_LIST
.
getCode
(),
data
);
staffDepartmentRelatedApiService
.
sendSingleMessage
(
clerkId
,
"分配会员通知"
,
content
,
pageUrl
);
}
}
else
{
//把别人的的clerkCode置空
...
...
@@ -158,7 +194,6 @@ public class BindApiServiceImpl implements BindApiService {
dto
.
setUpdateTime
(
new
Date
());
staffDepartmentRelatedApiService
.
updateById
(
dto
);
//更新gic数据
DepartmentDTO
departmentDTO
=
departmentApiService
.
selectById
(
departmentId
);
String
storeId
=
departmentDTO
.
getRelatedId
();
List
<
String
>
clerkCodes
=
new
ArrayList
<>();
clerkCodes
.
add
(
fromClerkCode
);
...
...
@@ -184,6 +219,25 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
//发送消息
if
(
StringUtil
.
isNotBlank
(
dto
.
getClerkCode
())){
//发送消息
ClerkDTO
leader
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
String
clerkId
=
leader
.
getClerkId
();
String
storeName
=
departmentDTO
.
getDepartmentName
();
String
staffName
=
staffDTO
.
getStaffName
();
String
leaderName
=
leader
.
getClerkName
();
String
clerkCode
=
dto
.
getClerkCode
();
String
content
=
"【"
+
leaderName
+
"】:【"
+
storeName
+
"】"
+
staffName
+
"导购code:"
+
clerkCode
+
"已解绑,请重新分配会员!"
;
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
MEMBER_LIST
.
getCode
(),
data
);
staffDepartmentRelatedApiService
.
sendSingleMessage
(
clerkId
,
"分配会员通知"
,
content
,
pageUrl
);
}
}
}
@Transactional
...
...
@@ -203,12 +257,29 @@ public class BindApiServiceImpl implements BindApiService {
List
<
String
>
clerkCodes
=
new
ArrayList
<>();
clerkCodes
.
add
(
fromClerkCode
);
List
<
ClerkDTO
>
list
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
String
clerkName
=
CollectionUtil
.
isEmpty
(
list
)?
null
:
list
.
get
(
0
).
getClerkName
();
//获取姓名,发消息用
for
(
ClerkDTO
clerkDTO
:
list
){
clerkDTO
.
setPhoneNumber
(
"--"
);
clerkDTO
.
setClerkName
(
clerkDTO
.
getClerkName
()+
"(已解绑)"
);
clerkDTO
.
setHeadImgUrl
(
""
);
clerkService
.
updateClerk
(
clerkDTO
);
}
}
//发送消息
if
(
StringUtil
.
isNotBlank
(
fromClerkCode
)){
//发送消息
ClerkDTO
leader
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
String
clerkId
=
leader
.
getClerkId
();
String
storeName
=
departmentDTO
.
getDepartmentName
();
String
staffName
=
clerkName
;
String
leaderName
=
leader
.
getClerkName
();
String
clerkCode
=
fromClerkCode
;
String
content
=
"【"
+
leaderName
+
"】:【"
+
storeName
+
"】"
+
staffName
+
"导购code:"
+
clerkCode
+
"已解绑,请重新分配会员!"
;
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
MEMBER_LIST
.
getCode
(),
data
);
staffDepartmentRelatedApiService
.
sendSingleMessage
(
clerkId
,
"分配会员通知"
,
content
,
pageUrl
);
}
}
@Transactional
@Override
...
...
@@ -245,6 +316,7 @@ public class BindApiServiceImpl implements BindApiService {
List
<
String
>
clerkCodes
=
new
ArrayList
<>();
clerkCodes
.
add
(
fromClerkCode
);
List
<
ClerkDTO
>
list
=
clerkService
.
listClerk
(
storeId
,
clerkCodes
,
true
);
String
clerkName
=
CollectionUtil
.
isEmpty
(
list
)?
null
:
list
.
get
(
0
).
getClerkName
();
//获取姓名,发消息用
StaffDepartmentRelatedDTO
staffDepartmentRelatedDTO
=
staffDepartmentRelatedApiService
.
getByStaffDepartmentRelatedId
(
fromStaffDepartmentRelatedId
);
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffDepartmentRelatedDTO
.
getStaffId
());
for
(
ClerkDTO
clerkDTO
:
list
){
...
...
@@ -252,7 +324,24 @@ public class BindApiServiceImpl implements BindApiService {
clerkDTO
.
setClerkName
(
staffDTO
.
getStaffName
());
clerkDTO
.
setHeadImgUrl
(
StringUtils
.
isEmpty
(
staffDTO
.
getHeadImg
())?
""
:
staffDTO
.
getHeadImg
());
clerkService
.
updateClerk
(
clerkDTO
);
}
}
//发送消息
if
(
StringUtil
.
isNotBlank
(
fromClerkCode
)){
//发送消息
ClerkDTO
leader
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
String
clerkId
=
leader
.
getClerkId
();
String
storeName
=
departmentDTO
.
getDepartmentName
();
String
staffName
=
clerkName
;
String
leaderName
=
leader
.
getClerkName
();
String
clerkCode
=
fromClerkCode
;
String
content
=
"【"
+
leaderName
+
"】:【"
+
storeName
+
"】"
+
staffName
+
"导购code:"
+
clerkCode
+
"已解绑,请重新分配会员!"
;
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
MEMBER_LIST
.
getCode
(),
data
);
staffDepartmentRelatedApiService
.
sendSingleMessage
(
clerkId
,
"分配会员通知"
,
content
,
pageUrl
);
}
}
...
...
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