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
375e1aa8
Commit
375e1aa8
authored
Dec 23, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:推送兼容
parent
10aca368
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
487 additions
and
385 deletions
+487
-385
ExternalClerkRelatedApiService.java
...an/manage/api/service/ExternalClerkRelatedApiService.java
+8
-6
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+17
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+11
-10
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+13
-2
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+22
-5
StaffDepartmentRelatedApiServiceImpl.java
...ervice/out/impl/StaffDepartmentRelatedApiServiceImpl.java
+389
-362
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+27
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ExternalClerkRelatedApiService.java
View file @
375e1aa8
...
@@ -165,13 +165,15 @@ public interface ExternalClerkRelatedApiService {
...
@@ -165,13 +165,15 @@ public interface ExternalClerkRelatedApiService {
/**
/**
* 批量查询会员与导购好友关系
* 批量查询会员与导购好友关系
*
*
* @param memberIdList 会员id列表
* @param memberIdList 会员id列表
* @param clerkIdList 导购id列表
* @param clerkIdList 导购id列表
* @param enterpriseId 企业id
* @param enterpriseId 企业id
* @return map:key-会员id value-导购的wxUserId
* @param wxEnterpriseId wx企业标识
* @author: YongEn
* @return {@link Map<String, List<ClerkStaffWxUserDTO>> }
* @author mozhu
* @date 2021-12-23 15:43:03
*/
*/
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
);
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
,
String
wxEnterpriseId
);
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
375e1aa8
...
@@ -154,4 +154,20 @@ public interface TabHaobanStaffClerkRelationMapper {
...
@@ -154,4 +154,20 @@ public interface TabHaobanStaffClerkRelationMapper {
@Param
(
"memberIdList"
)
List
<
String
>
memberIdList
,
@Param
(
"memberIdList"
)
List
<
String
>
memberIdList
,
@Param
(
"clerkIdList"
)
List
<
String
>
clerkIdList
,
@Param
(
"clerkIdList"
)
List
<
String
>
clerkIdList
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 批量查询会员与导购关系并且返回关联信息(新企业)
*
* @param memberIdList 会员id列表
* @param clerkIdList 职员id列表
* @param enterpriseId 企业标识
* @return {@link List<MemberStaffRelExtDO> }
* @author mozhu
* @date 2021-12-23 15:45:48
*/
List
<
MemberStaffRelExtDO
>
listMemberStaffRelNew
(
@Param
(
"memberIdList"
)
List
<
String
>
memberIdList
,
@Param
(
"clerkIdList"
)
List
<
String
>
clerkIdList
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
375e1aa8
...
@@ -65,7 +65,7 @@ import com.github.pagehelper.PageHelper;
...
@@ -65,7 +65,7 @@ import com.github.pagehelper.PageHelper;
*/
*/
@Service
@Service
public
class
AuditApiServiceImpl
implements
AuditApiService
{
public
class
AuditApiServiceImpl
implements
AuditApiService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AuditApiServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AuditApiServiceImpl
.
class
);
@Autowired
@Autowired
private
TabHaobanAuditMapper
auditMapper
;
private
TabHaobanAuditMapper
auditMapper
;
...
@@ -386,7 +386,7 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -386,7 +386,7 @@ public class AuditApiServiceImpl implements AuditApiService{
String
areaId
=
obj
.
getAreaId
();
String
areaId
=
obj
.
getAreaId
();
String
storeAddress
=
obj
.
getStoreAddress
();
String
storeAddress
=
obj
.
getStoreAddress
();
logger
.
info
(
"==========================>areaId={},storeAddress={},newValue={}"
,
areaId
,
storeAddress
,
newValue
);
logger
.
info
(
"==========================>areaId={},storeAddress={},newValue={}"
,
areaId
,
storeAddress
,
newValue
);
String
arr
[]
=
storeAddress
.
split
(
" "
);
String
[]
arr
=
storeAddress
.
split
(
" "
);
store
.
setAreaId
(
areaId
);
store
.
setAreaId
(
areaId
);
store
.
setFullArea
(
arr
[
0
]);
store
.
setFullArea
(
arr
[
0
]);
//避免多个空格造成数据混乱
//避免多个空格造成数据混乱
...
@@ -431,19 +431,24 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -431,19 +431,24 @@ public class AuditApiServiceImpl implements AuditApiService{
content
.
substring
(
0
,
26
);
content
.
substring
(
0
,
26
);
content
=
content
+
"..."
;
content
=
content
+
"..."
;
}
}
String
wxUserId
=
staff
.
getWxUserId
();
String
staffName
=
staff
.
getStaffName
();
String
staffName
=
staff
.
getStaffName
();
String
wxEnterpriseId
=
staff
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
staff
.
getWxEnterpriseId
();
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
wxEnterpriseId
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
wxEnterpriseId
);
String
corpId
=
tabHaobanWxEnterprise
.
getCorpid
();
String
corpId
=
tabHaobanWxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
if
(
corpId
.
length
()
>
20
)
{
wxUserId
=
staff
.
getWxOpenUseId
();
}
else
{
wxUserId
=
staff
.
getWxUserId
();
}
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
STORE_DETAIL
.
getCode
(),
data
);
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
STORE_DETAIL
.
getCode
(),
data
);
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
;
List
<
ItemDTO
>
items
=
new
ArrayList
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
dto1
.
setKey
(
"接收人"
);
dto1
.
setKey
(
"接收人"
);
...
@@ -522,11 +527,7 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -522,11 +527,7 @@ public class AuditApiServiceImpl implements AuditApiService{
public
boolean
judgeHavePhoneNumberOrCode
(
String
enterpriseId
,
public
boolean
judgeHavePhoneNumberOrCode
(
String
enterpriseId
,
String
clerkCode
,
String
phoneNumber
)
{
String
clerkCode
,
String
phoneNumber
)
{
List
<
TabHaobanAudit
>
list
=
auditMapper
.
judgeHavePhoneNumberOrCode
(
enterpriseId
,
clerkCode
,
phoneNumber
);
List
<
TabHaobanAudit
>
list
=
auditMapper
.
judgeHavePhoneNumberOrCode
(
enterpriseId
,
clerkCode
,
phoneNumber
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
!
CollectionUtil
.
isEmpty
(
list
);
return
false
;
}
else
{
return
true
;
}
}
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
375e1aa8
...
@@ -271,12 +271,23 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
...
@@ -271,12 +271,23 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
}
}
@Override
@Override
public
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
)
{
public
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
,
String
wxEnterpriseId
)
{
if
(
CollectionUtils
.
isEmpty
(
memberIdList
)
||
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
memberIdList
)
||
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
// 2个列表都为空查不了关系
// 2个列表都为空查不了关系
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
List
<
MemberStaffRelExtDO
>
res
=
staffClerkRelationMapper
.
listMemberStaffRel
(
memberIdList
,
clerkIdList
,
enterpriseId
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterriseMapper
.
selectByPrimaryKey
(
wxEnterpriseId
);
if
(
tabHaobanWxEnterprise
==
null
)
{
return
Collections
.
emptyMap
();
}
//新老企业兼容
String
corpid
=
tabHaobanWxEnterprise
.
getCorpid
();
List
<
MemberStaffRelExtDO
>
res
=
new
ArrayList
<>();
if
(
corpid
.
length
()
>
20
)
{
res
=
staffClerkRelationMapper
.
listMemberStaffRelNew
(
memberIdList
,
clerkIdList
,
enterpriseId
);
}
else
{
res
=
staffClerkRelationMapper
.
listMemberStaffRel
(
memberIdList
,
clerkIdList
,
enterpriseId
);
}
if
(
CollectionUtils
.
isEmpty
(
res
))
{
if
(
CollectionUtils
.
isEmpty
(
res
))
{
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
375e1aa8
...
@@ -430,7 +430,14 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -430,7 +430,14 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"企业为空"
);
log
.
info
(
"企业为空"
);
return
false
;
return
false
;
}
}
String
userId
=
relation
.
getWxUserId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
relation
.
getStaffId
());
String
corpid
=
wxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
if
(
corpid
.
length
()
>
20
)
{
wxUserId
=
staffDTO
.
getWxOpenUseId
();
}
else
{
wxUserId
=
staffDTO
.
getWxUserId
();
}
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"事件"
,
"人脸匹配"
);
map
.
put
(
"事件"
,
"人脸匹配"
);
...
@@ -438,13 +445,13 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -438,13 +445,13 @@ public class MessageApiServiceImpl implements MessageApiService {
map
.
put
(
"到店时间"
,
arrivalTime
);
map
.
put
(
"到店时间"
,
arrivalTime
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
u
serId
);
list
.
add
(
wxU
serId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setTitle
(
"我的顾客通知"
);
messageDTO
.
setTitle
(
"我的顾客通知"
);
messageDTO
.
setItems
(
items
);
messageDTO
.
setItems
(
items
);
return
qywxSuiteApiService
.
sendMessage
(
wxEnterprise
.
getCorpid
()
,
config
.
getWxSuiteid
(),
messageDTO
);
return
qywxSuiteApiService
.
sendMessage
(
corpid
,
config
.
getWxSuiteid
(),
messageDTO
);
}
}
private
List
<
ItemDTO
>
getItemsList
(
Map
<
String
,
String
>
map
)
{
private
List
<
ItemDTO
>
getItemsList
(
Map
<
String
,
String
>
map
)
{
...
@@ -477,7 +484,17 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -477,7 +484,17 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"企业为空"
);
log
.
info
(
"企业为空"
);
return
false
;
return
false
;
}
}
String
userId
=
relation
.
getWxUserId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
relation
.
getStaffId
());
if
(
staffDTO
==
null
)
{
return
false
;
}
String
corpId
=
wxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
if
(
corpId
.
length
()
>
20
)
{
wxUserId
=
staffDTO
.
getWxOpenUseId
();
}
else
{
wxUserId
=
staffDTO
.
getWxUserId
();
}
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"事件"
,
"会员完善标签"
);
map
.
put
(
"事件"
,
"会员完善标签"
);
...
@@ -486,7 +503,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -486,7 +503,7 @@ public class MessageApiServiceImpl implements MessageApiService {
map
.
put
(
"消费时间"
,
customerTime
);
map
.
put
(
"消费时间"
,
customerTime
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
u
serId
);
list
.
add
(
wxU
serId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffDepartmentRelatedApiServiceImpl.java
View file @
375e1aa8
...
@@ -37,324 +37,351 @@ import java.util.*;
...
@@ -37,324 +37,351 @@ import java.util.*;
public
class
StaffDepartmentRelatedApiServiceImpl
implements
StaffDepartmentRelatedApiService
{
public
class
StaffDepartmentRelatedApiServiceImpl
implements
StaffDepartmentRelatedApiService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StaffDepartmentRelatedApiServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StaffDepartmentRelatedApiServiceImpl
.
class
);
@Autowired
@Autowired
private
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
private
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
@Autowired
@Autowired
private
StaffDepartmentRelatedMapper
staffDepartmentRelatedMapper
;
private
StaffDepartmentRelatedMapper
staffDepartmentRelatedMapper
;
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
@Autowired
private
WxEnterpriseMapper
wxEnterpriseMapper
;
private
WxEnterpriseMapper
wxEnterpriseMapper
;
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
@Autowired
@Autowired
private
TabHaobanStaffClerkRelationMapper
tabHaobanStaffClerkRelationMapper
;
private
TabHaobanStaffClerkRelationMapper
tabHaobanStaffClerkRelationMapper
;
@Autowired
@Autowired
private
StaffApiService
staffApiService
;
private
StaffApiService
staffApiService
;
@Override
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentId
(
String
departmentId
)
{
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentId
(
String
departmentId
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
departmentId
);
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
departmentId
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
return
resultList
;
return
resultList
;
}
}
@Override
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentIds
(
List
<
String
>
departmentIds
)
{
public
List
<
StaffDepartmentRelatedDTO
>
listByDepartmentIds
(
List
<
String
>
departmentIds
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listByDepartmentIds
(
departmentIds
);
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listByDepartmentIds
(
departmentIds
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
return
resultList
;
return
resultList
;
}
}
@Override
@Override
public
void
updateById
(
StaffDepartmentRelatedDTO
dto
)
{
public
void
updateById
(
StaffDepartmentRelatedDTO
dto
)
{
TabHaobanStaffDepartmentRelated
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
dto
);
TabHaobanStaffDepartmentRelated
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
dto
);
staffDepartmentRelatedMapper
.
updateByPrimaryKeySelective
(
tab
);
staffDepartmentRelatedMapper
.
updateByPrimaryKeySelective
(
tab
);
}
}
@Override
@Override
public
void
deleteCode
(
StaffDepartmentRelatedDTO
dto
)
{
public
void
deleteCode
(
StaffDepartmentRelatedDTO
dto
)
{
staffDepartmentRelatedMapper
.
deleteCode
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
dto
));
staffDepartmentRelatedMapper
.
deleteCode
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
dto
));
}
}
@Override
@Override
public
StaffDepartmentRelatedDTO
getByStaffDepartmentRelatedId
(
String
staffDepartmentRelatedId
)
{
public
StaffDepartmentRelatedDTO
getByStaffDepartmentRelatedId
(
String
staffDepartmentRelatedId
)
{
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedMapper
.
getById
(
staffDepartmentRelatedId
);
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedMapper
.
getById
(
staffDepartmentRelatedId
);
if
(
Objects
.
isNull
(
tab
)){
if
(
Objects
.
isNull
(
tab
))
{
return
null
;
return
null
;
}
}
StaffDepartmentRelatedDTO
dto
=
EntityUtil
.
changeEntity
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
StaffDepartmentRelatedDTO
dto
=
EntityUtil
.
changeEntity
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
return
dto
;
return
dto
;
}
}
@Override
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByStaffId
(
String
staffId
)
{
public
List
<
StaffDepartmentRelatedDTO
>
listByStaffId
(
String
staffId
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listStaffDepartmentByStaffId
(
staffId
);
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listStaffDepartmentByStaffId
(
staffId
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
if
(
CollectionUtil
.
isEmpty
(
list
))
{
return
new
ArrayList
<
StaffDepartmentRelatedDTO
>();
return
new
ArrayList
<
StaffDepartmentRelatedDTO
>();
}
}
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
return
resultList
;
return
resultList
;
}
}
@Override
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listByStaffIds
(
List
<
String
>
staffIds
)
{
public
List
<
StaffDepartmentRelatedDTO
>
listByStaffIds
(
List
<
String
>
staffIds
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listStaffDepartmentByStaffIds
(
staffIds
);
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedMapper
.
listStaffDepartmentByStaffIds
(
staffIds
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
if
(
CollectionUtil
.
isEmpty
(
list
))
{
return
new
ArrayList
<
StaffDepartmentRelatedDTO
>();
return
new
ArrayList
<
StaffDepartmentRelatedDTO
>();
}
}
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
List
<
StaffDepartmentRelatedDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
return
resultList
;
return
resultList
;
}
}
@Override
@Override
public
StaffDepartmentRelatedDTO
getOneByClerkCodeAndDepartmentId
(
String
clerkCode
,
String
departmentId
)
{
public
StaffDepartmentRelatedDTO
getOneByClerkCodeAndDepartmentId
(
String
clerkCode
,
String
departmentId
)
{
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedMapper
.
getDepartmentIdAndCode
(
departmentId
,
clerkCode
);
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedMapper
.
getDepartmentIdAndCode
(
departmentId
,
clerkCode
);
if
(
tab
==
null
){
if
(
tab
==
null
)
{
return
null
;
return
null
;
}
}
StaffDepartmentRelatedDTO
dto
=
EntityUtil
.
changeEntity
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
StaffDepartmentRelatedDTO
dto
=
EntityUtil
.
changeEntity
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
return
dto
;
return
dto
;
}
}
@Override
public
StaffDepartmentRelatedDTO
getOneByStaffIdAndDepartmentId
(
String
staffId
,
String
departmentId
)
{
@Override
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedMapper
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
public
StaffDepartmentRelatedDTO
getOneByStaffIdAndDepartmentId
(
String
staffId
,
String
departmentId
)
{
if
(
tab
==
null
){
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedMapper
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
return
null
;
if
(
tab
==
null
)
{
}
return
null
;
StaffDepartmentRelatedDTO
dto
=
EntityUtil
.
changeEntity
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
}
return
dto
;
StaffDepartmentRelatedDTO
dto
=
EntityUtil
.
changeEntity
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
}
return
dto
;
}
@Override
public
Map
<
String
,
String
>
getWxUserIdByClerkId
(
String
clerkId
)
{
@Override
Map
<
String
,
String
>
map
=
new
HashMap
<>();
public
Map
<
String
,
String
>
getWxUserIdByClerkId
(
String
clerkId
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
clerkId
);
if
(
tab
==
null
){
TabHaobanStaffClerkRelation
relation
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
clerkId
);
return
map
;
if
(
relation
==
null
)
{
}
return
map
;
ClerkDTO
clerkDTO
=
clerkService
.
getclerkById
(
clerkId
);
}
if
(
clerkDTO
==
null
){
ClerkDTO
clerkDTO
=
clerkService
.
getclerkById
(
clerkId
);
return
map
;
if
(
clerkDTO
==
null
)
{
}
return
map
;
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
tab
.
getWxEnterpriseId
());
}
map
.
put
(
"wxUserId"
,
tab
.
getWxUserId
());
TabHaobanWxEnterprise
wxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
relation
.
getWxEnterpriseId
());
map
.
put
(
"wxEnterpriseId"
,
tab
.
getWxEnterpriseId
());
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
relation
.
getStaffId
());
map
.
put
(
"corpId"
,
tabHaobanWxEnterprise
.
getCorpid
());
if
(
staffDTO
==
null
)
{
map
.
put
(
"clerkName"
,
clerkDTO
.
getClerkName
());
return
map
;
return
map
;
}
}
String
corpid
=
wxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
public
Map
<
String
,
String
>
getWxUserIdByStaffId
(
String
staffId
)
{
if
(
corpid
.
length
()
>
20
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
wxUserId
=
staffDTO
.
getWxOpenUseId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
}
else
{
if
(
staffDTO
==
null
){
wxUserId
=
staffDTO
.
getWxUserId
();
return
map
;
}
}
map
.
put
(
"wxUserId"
,
wxUserId
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
staffDTO
.
getWxEnterpriseId
());
map
.
put
(
"wxEnterpriseId"
,
wxEnterprise
.
getWxEnterpriseId
());
map
.
put
(
"wxUserId"
,
staffDTO
.
getWxUserId
());
map
.
put
(
"corpId"
,
wxEnterprise
.
getCorpid
());
map
.
put
(
"wxEnterpriseId"
,
tabHaobanWxEnterprise
.
getWxEnterpriseId
());
map
.
put
(
"clerkName"
,
clerkDTO
.
getClerkName
());
map
.
put
(
"corpId"
,
tabHaobanWxEnterprise
.
getCorpid
());
return
map
;
map
.
put
(
"staffName"
,
staffDTO
.
getStaffName
());
}
return
map
;
}
public
Map
<
String
,
String
>
getWxUserIdByStaffId
(
String
staffId
)
{
//导购绑定,,审核记录,,消息发送
Map
<
String
,
String
>
map
=
new
HashMap
<>();
@Override
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
public
void
sendStaffBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
){
if
(
staffDTO
==
null
)
{
return
map
;
}
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
staffDTO
.
getWxEnterpriseId
());
String
corpid
=
tabHaobanWxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
if
(
corpid
.
length
()
>
20
)
{
wxUserId
=
staffDTO
.
getWxOpenUseId
();
}
else
{
wxUserId
=
staffDTO
.
getWxUserId
();
}
map
.
put
(
"wxUserId"
,
wxUserId
);
map
.
put
(
"wxEnterpriseId"
,
tabHaobanWxEnterprise
.
getWxEnterpriseId
());
map
.
put
(
"corpId"
,
tabHaobanWxEnterprise
.
getCorpid
());
map
.
put
(
"staffName"
,
staffDTO
.
getStaffName
());
return
map
;
}
//导购绑定,,审核记录,,消息发送
@Override
public
void
sendStaffBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
//TODO huang 发送申请人,我的记录页
//TODO huang 发送申请人,我的记录页
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
if
(
staffDTO
==
null
)
{
logger
.
info
(
"staff不存在,发送消息失败{}"
,
staffId
);
logger
.
info
(
"staff不存在,发送消息失败{}"
,
staffId
);
return
;
return
;
}
}
String
messageTitle
=
"门店账号申请"
;
String
messageTitle
=
"门店账号申请"
;
String
content
=
staffDTO
.
getStaffName
()+
"申请关联导购code("
+
clerkCode
+
")"
;
String
content
=
staffDTO
.
getStaffName
()
+
"申请关联导购code("
+
clerkCode
+
")"
;
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
MY_RELATED_RECORD
.
getCode
(),
data
);
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
MY_RELATED_RECORD
.
getCode
(),
data
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
staffDTO
.
getWxEnterpriseId
());
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterpriseMapper
.
selectByPrimaryKey
(
staffDTO
.
getWxEnterpriseId
());
String
wxUserId
=
staffDTO
.
getWxUserId
();
String
corpId
=
tabHaobanWxEnterprise
.
getCorpid
();
String
corpId
=
tabHaobanWxEnterprise
.
getCorpid
();
String
name
=
staffDTO
.
getStaffName
();
String
name
=
staffDTO
.
getStaffName
();
if
(
content
.
length
()
>
30
)
{
if
(
content
.
length
()
>
30
)
{
content
=
content
.
substring
(
0
,
26
);
content
=
content
.
substring
(
0
,
26
);
content
=
content
+
"..."
;
content
=
content
+
"..."
;
}
}
String
wxUserId
=
""
;
//先发送下,试试
if
(
corpId
.
length
()
>
20
)
{
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
wxUserId
=
staffDTO
.
getWxOpenUseId
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
}
else
{
ItemDTO
dto1
=
new
ItemDTO
();
wxUserId
=
staffDTO
.
getWxUserId
();
ItemDTO
dto2
=
new
ItemDTO
();
}
ItemDTO
dto3
=
new
ItemDTO
();
//先发送下,试试
ItemDTO
dto4
=
new
ItemDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
dto1
.
setKey
(
"接收人"
);
ItemDTO
dto1
=
new
ItemDTO
();
dto1
.
setValue
(
name
);
ItemDTO
dto2
=
new
ItemDTO
();
dto2
.
setKey
(
"接收事件"
);
ItemDTO
dto3
=
new
ItemDTO
();
dto2
.
setValue
(
content
);
ItemDTO
dto4
=
new
ItemDTO
();
dto3
.
setKey
(
"结果"
);
dto3
.
setValue
(
auditStatus
==
1
?
"已同意"
:
"已拒绝"
);
dto1
.
setKey
(
"接收人"
);
items
.
add
(
dto1
);
dto1
.
setValue
(
name
);
items
.
add
(
dto2
);
dto2
.
setKey
(
"接收事件"
);
items
.
add
(
dto3
);
dto2
.
setValue
(
content
);
if
(
StringUtils
.
isNotEmpty
(
auditReason
)){
dto3
.
setKey
(
"结果"
);
dto4
.
setKey
(
"理由"
);
dto3
.
setValue
(
auditStatus
==
1
?
"已同意"
:
"已拒绝"
);
dto4
.
setValue
(
auditReason
);
items
.
add
(
dto1
);
items
.
add
(
dto4
);
items
.
add
(
dto2
);
}
items
.
add
(
dto3
);
if
(
StringUtils
.
isNotEmpty
(
auditReason
))
{
dto4
.
setKey
(
"理由"
);
dto4
.
setValue
(
auditReason
);
items
.
add
(
dto4
);
}
ArrayList
<
String
>
list
=
new
ArrayList
<>();
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
wxUserId
);
list
.
add
(
wxUserId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setTitle
(
messageTitle
);
messageDTO
.
setTitle
(
messageTitle
);
messageDTO
.
setItems
(
items
);
messageDTO
.
setItems
(
items
);
logger
.
info
(
"发送参数为corpId============:{},suitId============:{},messageDTO============:{},"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
logger
.
info
(
"发送参数为corpId============:{},suitId============:{},messageDTO============:{},"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
logger
.
info
(
"发送===============》{}"
,
b
);
logger
.
info
(
"发送===============》{}"
,
b
);
}
}
//导购绑定,,审核记录,,消息发送
@Override
//导购绑定,,审核记录,,消息发送
public
void
sendClerkBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
){
@Override
public
void
sendClerkBind
(
String
staffId
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
//TODO huang 发送申请人,我的记录页
//TODO huang 发送申请人,我的记录页
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
if
(
staffDTO
==
null
)
{
logger
.
info
(
"staff不存在,发送消息失败{}"
,
staffId
);
logger
.
info
(
"staff不存在,发送消息失败{}"
,
staffId
);
return
;
return
;
}
}
String
messageTitle
=
"门店账号申请"
;
String
messageTitle
=
"门店账号申请"
;
String
messageContent
=
staffDTO
.
getStaffName
()+
"申请关联导购code("
+
clerkCode
+
")"
;
String
messageContent
=
staffDTO
.
getStaffName
()
+
"申请关联导购code("
+
clerkCode
+
")"
;
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
MY_RELATED_RECORD
.
getCode
(),
data
);
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
MY_RELATED_RECORD
.
getCode
(),
data
);
this
.
sendAuditMessage
(
staffId
,
messageTitle
,
messageContent
,
pageUrl
,
auditStatus
,
auditReason
);
this
.
sendAuditMessage
(
staffId
,
messageTitle
,
messageContent
,
pageUrl
,
auditStatus
,
auditReason
);
}
}
//导购新增,,审核记录,,消息发送
//导购新增,,审核记录,,消息发送
@Override
@Override
public
void
sendClerkAdd
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
public
void
sendClerkAdd
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
//TODO huang 发送店长,门店关联记录列表
//TODO huang 发送店长,门店关联记录列表
String
messageTitle
=
"门店导购变更"
;
String
messageTitle
=
"门店导购变更"
;
String
messageContent
=
"新增导购:"
+
clerkName
+
"("
+
clerkCode
+
")"
;
String
messageContent
=
"新增导购:"
+
clerkName
+
"("
+
clerkCode
+
")"
;
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
data
=
jsonObject
.
toJSONString
();
ClerkDTO
gicClerk
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
ClerkDTO
gicClerk
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
if
(
gicClerk
==
null
){
if
(
gicClerk
==
null
)
{
logger
.
info
(
"店长不存在,发送消息失败{}"
,
storeId
);
logger
.
info
(
"店长不存在,发送消息失败{}"
,
storeId
);
return
;
return
;
}
}
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
gicClerk
.
getClerkId
());
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
gicClerk
.
getClerkId
());
if
(
tab
==
null
){
if
(
tab
==
null
)
{
logger
.
info
(
"店长未绑定clerkId={}"
,
gicClerk
.
getClerkId
());
logger
.
info
(
"店长未绑定clerkId={}"
,
gicClerk
.
getClerkId
());
return
;
return
;
}
}
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
STORE_RELATED_RECORD
.
getCode
(),
data
);
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
STORE_RELATED_RECORD
.
getCode
(),
data
);
this
.
sendAuditMessage
(
tab
.
getStaffId
(),
messageTitle
,
messageContent
,
pageUrl
,
auditStatus
,
auditReason
);
this
.
sendAuditMessage
(
tab
.
getStaffId
(),
messageTitle
,
messageContent
,
pageUrl
,
auditStatus
,
auditReason
);
}
}
//导购删除,,审核记录,,消息发送
//导购删除,,审核记录,,消息发送
@Override
@Override
public
void
sendClerkDel
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
public
void
sendClerkDel
(
String
clerkName
,
String
clerkCode
,
String
storeId
,
int
auditStatus
,
String
auditReason
)
{
String
messageTitle
=
"门店导购变更"
;
String
messageTitle
=
"门店导购变更"
;
String
messageContent
=
"删除导购:"
+
clerkName
+
"("
+
clerkCode
+
")"
;
String
messageContent
=
"删除导购:"
+
clerkName
+
"("
+
clerkCode
+
")"
;
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"storeId"
,
storeId
);
jsonObject
.
put
(
"storeId"
,
storeId
);
String
data
=
jsonObject
.
toJSONString
();
String
data
=
jsonObject
.
toJSONString
();
ClerkDTO
gicClerk
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
ClerkDTO
gicClerk
=
clerkService
.
getClerkLeaderByStoreId
(
storeId
);
if
(
gicClerk
==
null
)
{
if
(
gicClerk
==
null
)
{
logger
.
info
(
"店长不存在,发送消息失败{}"
,
storeId
);
logger
.
info
(
"店长不存在,发送消息失败{}"
,
storeId
);
return
;
return
;
}
}
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
gicClerk
.
getClerkId
());
TabHaobanStaffClerkRelation
tab
=
tabHaobanStaffClerkRelationMapper
.
getOneByClerkId
(
gicClerk
.
getClerkId
());
if
(
tab
==
null
){
if
(
tab
==
null
)
{
logger
.
info
(
"店长未绑定clerkId={}"
,
gicClerk
.
getClerkId
());
logger
.
info
(
"店长未绑定clerkId={}"
,
gicClerk
.
getClerkId
());
return
;
return
;
}
}
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
STORE_RELATED_RECORD
.
getCode
(),
data
);
String
pageUrl
=
this
.
getPageUrl
(
AppPageType
.
STORE_RELATED_RECORD
.
getCode
(),
data
);
this
.
sendAuditMessage
(
tab
.
getStaffId
(),
messageTitle
,
messageContent
,
pageUrl
,
auditStatus
,
auditReason
);
this
.
sendAuditMessage
(
tab
.
getStaffId
(),
messageTitle
,
messageContent
,
pageUrl
,
auditStatus
,
auditReason
);
}
}
@Override
public
boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
@Override
String
content
,
String
pageUrl
)
{
public
boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
if
(
StringUtils
.
isEmpty
(
clerkId
))
{
String
content
,
String
pageUrl
)
{
logger
.
info
(
"clerkId不存在============>"
);
if
(
StringUtils
.
isEmpty
(
clerkId
))
{
return
false
;
logger
.
info
(
"clerkId不存在============>"
);
}
return
false
;
Map
<
String
,
String
>
map
=
getWxUserIdByClerkId
(
clerkId
);
}
String
wxUserId
=
map
.
get
(
"wxUserId"
);
Map
<
String
,
String
>
map
=
getWxUserIdByClerkId
(
clerkId
);
String
corpId
=
map
.
get
(
"corpId"
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
name
=
map
.
get
(
"clerkName"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
name
=
map
.
get
(
"clerkName"
);
if
(
StringUtils
.
isBlank
(
wxUserId
))
{
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
clerkId
);
if
(
StringUtils
.
isBlank
(
wxUserId
))
{
return
false
;
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
clerkId
);
}
return
false
;
if
(
content
.
length
()
>
30
)
{
}
content
=
content
.
substring
(
0
,
26
);
if
(
content
.
length
()
>
30
)
{
content
=
content
+
"..."
;
content
=
content
.
substring
(
0
,
26
);
}
content
=
content
+
"..."
;
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
}
List
<
ItemDTO
>
items
=
new
ArrayList
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
dto1
.
setKey
(
"接收人"
);
ItemDTO
dto2
=
new
ItemDTO
();
dto1
.
setValue
(
name
);
dto1
.
setKey
(
"接收人"
);
dto2
.
setKey
(
"接收事件"
);
dto1
.
setValue
(
name
);
dto2
.
setValue
(
content
);
dto2
.
setKey
(
"接收事件"
);
items
.
add
(
dto1
);
dto2
.
setValue
(
content
);
items
.
add
(
dto2
);
items
.
add
(
dto1
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
items
.
add
(
dto2
);
list
.
add
(
wxUserId
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
messageDTO
.
setAppid
(
config
.
getAppid
());
list
.
add
(
wxUserId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setTitle
(
title
);
messageDTO
.
setTitle
(
title
);
messageDTO
.
setItems
(
items
);
messageDTO
.
setItems
(
items
);
logger
.
info
(
"发送参数为corpId============:{},suitId============:{},messageDTO============:{},"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
logger
.
info
(
"发送参数为corpId============:{},suitId============:{},messageDTO============:{},"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
logger
.
info
(
"发送===============》{}"
,
b
);
logger
.
info
(
"发送===============》{}"
,
b
);
return
b
;
return
b
;
}
}
/**
/**
* 单人消息发送通用方法
* 单人消息发送通用方法
*
*
* @param clerkId : 接收人id
* @param clerkId
: 接收人id
* @param title : 通知标题
* @param title
: 通知标题
* @param contentMap : 时间集合, key 为类型, value : 内容(例如 接收事件 : 事件内容)
* @param contentMap : 时间集合, key 为类型, value : 内容(例如 接收事件 : 事件内容)
* @param pageUrl : 跳转地址
* @param pageUrl
: 跳转地址
* @return : 返回是否发送成功
* @return : 返回是否发送成功
*/
*/
@Override
@Override
public
Boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
Map
<
String
,
String
>
contentMap
,
String
pageUrl
)
{
public
Boolean
sendSingleMessage
(
String
clerkId
,
String
title
,
Map
<
String
,
String
>
contentMap
,
String
pageUrl
)
{
if
(
StringUtils
.
isEmpty
(
clerkId
))
{
if
(
StringUtils
.
isEmpty
(
clerkId
))
{
logger
.
info
(
"消息接收人不存在"
);
logger
.
info
(
"消息接收人不存在"
);
return
Boolean
.
FALSE
;
return
Boolean
.
FALSE
;
}
}
if
(
CollectionUtils
.
isEmpty
(
contentMap
))
{
if
(
CollectionUtils
.
isEmpty
(
contentMap
))
{
logger
.
info
(
"发送事件内容不存在"
);
logger
.
info
(
"发送事件内容不存在"
);
return
Boolean
.
FALSE
;
return
Boolean
.
FALSE
;
}
}
Map
<
String
,
String
>
map
=
this
.
getWxUserIdByClerkId
(
clerkId
);
Map
<
String
,
String
>
map
=
this
.
getWxUserIdByClerkId
(
clerkId
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
name
=
map
.
get
(
"clerkName"
);
String
name
=
map
.
get
(
"clerkName"
);
if
(
jodd
.
util
.
StringUtil
.
isEmpty
(
wxUserId
))
{
if
(
jodd
.
util
.
StringUtil
.
isEmpty
(
wxUserId
))
{
logger
.
info
(
"接收人wxUserId不存在, clerkId : {}"
,
clerkId
);
logger
.
info
(
"接收人wxUserId不存在, clerkId : {}"
,
clerkId
);
return
Boolean
.
FALSE
;
return
Boolean
.
FALSE
;
}
}
//组装发送内容
//组装发送内容
List
<
ItemDTO
>
contentList
=
new
ArrayList
<>();
List
<
ItemDTO
>
contentList
=
new
ArrayList
<>();
ItemDTO
dto
=
new
ItemDTO
();
ItemDTO
dto
=
new
ItemDTO
();
...
@@ -366,93 +393,93 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
...
@@ -366,93 +393,93 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
itemDTO
.
setKey
(
key
);
itemDTO
.
setKey
(
key
);
String
content
=
value
.
length
()
>
30
?
value
.
substring
(
0
,
26
)
+
"..."
:
value
;
String
content
=
value
.
length
()
>
30
?
value
.
substring
(
0
,
26
)
+
"..."
:
value
;
itemDTO
.
setValue
(
content
);
itemDTO
.
setValue
(
content
);
contentList
.
add
(
itemDTO
);
contentList
.
add
(
itemDTO
);
});
});
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
messageDTO
.
setAppid
(
this
.
config
.
getAppid
());
messageDTO
.
setAppid
(
this
.
config
.
getAppid
());
messageDTO
.
setUserIds
(
Collections
.
singletonList
(
wxUserId
));
messageDTO
.
setUserIds
(
Collections
.
singletonList
(
wxUserId
));
messageDTO
.
setTitle
(
title
);
messageDTO
.
setTitle
(
title
);
messageDTO
.
setItems
(
contentList
);
messageDTO
.
setItems
(
contentList
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
logger
.
info
(
"消息发送, corpId : {}, suitId : {}, messageDTO : {}"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
logger
.
info
(
"消息发送, corpId : {}, suitId : {}, messageDTO : {}"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
boolean
sendResult
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
boolean
sendResult
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
logger
.
info
(
"消息发送结果, sendResult : {}"
,
sendResult
);
logger
.
info
(
"消息发送结果, sendResult : {}"
,
sendResult
);
return
sendResult
;
return
sendResult
;
}
}
@Override
@Override
public
boolean
sendAuditMessage
(
String
staffId
,
String
title
,
public
boolean
sendAuditMessage
(
String
staffId
,
String
title
,
String
content
,
String
pageUrl
,
int
auditStatus
,
String
auditReason
)
{
String
content
,
String
pageUrl
,
int
auditStatus
,
String
auditReason
)
{
Map
<
String
,
String
>
map
=
getWxUserIdByStaffId
(
staffId
);
Map
<
String
,
String
>
map
=
getWxUserIdByStaffId
(
staffId
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
wxUserId
=
map
.
get
(
"wxUserId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
corpId
=
map
.
get
(
"corpId"
);
String
name
=
map
.
get
(
"staffName"
);
String
name
=
map
.
get
(
"staffName"
);
if
(
StringUtils
.
isEmpty
(
wxUserId
))
{
if
(
StringUtils
.
isEmpty
(
wxUserId
))
{
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
staffId
);
logger
.
info
(
"wxUserId不存在============clerkId={}"
,
staffId
);
return
false
;
return
false
;
}
}
if
(
content
.
length
()
>
30
)
{
if
(
content
.
length
()
>
30
)
{
content
=
content
.
substring
(
0
,
26
);
content
=
content
.
substring
(
0
,
26
);
content
=
content
+
"..."
;
content
=
content
+
"..."
;
}
}
//先发送下,试试
//先发送下,试试
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
List
<
ItemDTO
>
items
=
new
ArrayList
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
ItemDTO
dto4
=
new
ItemDTO
();
ItemDTO
dto4
=
new
ItemDTO
();
dto1
.
setKey
(
"接收人"
);
dto1
.
setKey
(
"接收人"
);
dto1
.
setValue
(
name
);
dto1
.
setValue
(
name
);
dto2
.
setKey
(
"接收事件"
);
dto2
.
setKey
(
"接收事件"
);
dto2
.
setValue
(
content
);
dto2
.
setValue
(
content
);
dto3
.
setKey
(
"结果"
);
dto3
.
setKey
(
"结果"
);
dto3
.
setValue
(
auditStatus
==
1
?
"已同意"
:
"已拒绝"
);
dto3
.
setValue
(
auditStatus
==
1
?
"已同意"
:
"已拒绝"
);
items
.
add
(
dto1
);
items
.
add
(
dto1
);
items
.
add
(
dto2
);
items
.
add
(
dto2
);
items
.
add
(
dto3
);
items
.
add
(
dto3
);
if
(
StringUtils
.
isNotEmpty
(
auditReason
))
{
if
(
StringUtils
.
isNotEmpty
(
auditReason
))
{
dto4
.
setKey
(
"理由"
);
dto4
.
setKey
(
"理由"
);
dto4
.
setValue
(
auditReason
);
dto4
.
setValue
(
auditReason
);
items
.
add
(
dto4
);
items
.
add
(
dto4
);
}
}
ArrayList
<
String
>
list
=
new
ArrayList
<>();
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
wxUserId
);
list
.
add
(
wxUserId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setTitle
(
title
);
messageDTO
.
setTitle
(
title
);
messageDTO
.
setItems
(
items
);
messageDTO
.
setItems
(
items
);
logger
.
info
(
"发送参数为corpId============:{},suitId============:{},messageDTO============:{},"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
logger
.
info
(
"发送参数为corpId============:{},suitId============:{},messageDTO============:{},"
,
corpId
,
config
.
getWxSuiteid
(),
JSONObject
.
toJSONString
(
messageDTO
));
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpId
,
config
.
getWxSuiteid
(),
messageDTO
);
logger
.
info
(
"发送===============》{}"
,
b
);
logger
.
info
(
"发送===============》{}"
,
b
);
return
b
;
return
b
;
}
}
@Override
@Override
public
String
getPageUrl
(
int
type
,
String
data
)
{
public
String
getPageUrl
(
int
type
,
String
data
)
{
String
baseUrl
=
"/pages/route/index"
;
String
baseUrl
=
"/pages/route/index"
;
String
addurl
=
AppPageType
.
getDescByCode
(
type
);
String
addurl
=
AppPageType
.
getDescByCode
(
type
);
String
url
=
""
;
String
url
=
""
;
if
(
type
==
AppPageType
.
INDEX
.
getCode
())
{
if
(
type
==
AppPageType
.
INDEX
.
getCode
())
{
//工作台
//工作台
url
=
baseUrl
+
"?pageType="
+
addurl
;
url
=
baseUrl
+
"?pageType="
+
addurl
;
}
else
{
}
else
{
url
=
baseUrl
+
"?pageType="
+
addurl
;
url
=
baseUrl
+
"?pageType="
+
addurl
;
}
}
url
=
url
+
"&data="
;
url
=
url
+
"&data="
;
String
encodeData
=
null
;
String
encodeData
=
null
;
try
{
try
{
encodeData
=
URLEncoder
.
encode
(
data
,
StandardCharsets
.
UTF_8
.
name
());
encodeData
=
URLEncoder
.
encode
(
data
,
StandardCharsets
.
UTF_8
.
name
());
}
catch
(
UnsupportedEncodingException
e
)
{
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
());
}
}
url
=
url
+
encodeData
;
url
=
url
+
encodeData
;
return
url
;
return
url
;
}
}
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
375e1aa8
...
@@ -400,4 +400,30 @@
...
@@ -400,4 +400,30 @@
</foreach>
;
</foreach>
;
</select>
</select>
<select
id=
"listMemberStaffRelNew"
resultType=
"com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO"
>
select ecr.member_id as memberId,
scr.wx_open_user_id as staffWxUserId,
scr.clerk_id as staffClerkId
from (select a.staff_id,
b.wx_open_user_id,
a.wx_user_id,
a.clerk_id
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on a.staff_id = b.staff_id
where a.clerk_id in
<foreach
collection=
"clerkIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
and a.status_flag = 1
group by a.staff_id, a.wx_user_id, a.clerk_id) as scr
left join tab_haoban_external_clerk_related as ecr on scr.staff_id = ecr.staff_id
where ecr.status_flag = 1
and ecr.enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and ecr.member_id in
<foreach
collection=
"memberIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
;
</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