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
0bc4ca04
Commit
0bc4ca04
authored
Aug 20, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
746758dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
18 deletions
+85
-18
AppPageType.java
...ain/java/com/gic/haoban/manage/api/enums/AppPageType.java
+5
-1
MessageApiService.java
.../com/gic/haoban/manage/api/service/MessageApiService.java
+11
-2
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+69
-15
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/AppPageType.java
View file @
0bc4ca04
...
...
@@ -29,7 +29,11 @@ public enum AppPageType {
//门店关联记录
STORE_RELATED_RECORD
(
12
,
"store_relate_store_record_list"
),
//edaixi订单详情
EDAIXI_DETAIL
(
13
,
"hbapp_eWashing_order_preview"
);
EDAIXI_DETAIL
(
13
,
"hbapp_eWashing_order_preview"
),
//人脸到店
FACE_ARRIVAL
(
14
,
"hbapp_customer_bind_faceId"
),
//完善标签
PERFECT_TAG
(
15
,
"hbapp_customer_edit_tag "
);
AppPageType
(
int
type
,
String
desc
){
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MessageApiService.java
View file @
0bc4ca04
...
...
@@ -27,10 +27,19 @@ public interface MessageApiService {
/**
* 发送消费消息
* @param clerkId
* @param memberId
* @param memberName
* @param arrivalTime
* @param pageUrl
* @return
*/
Boolean
sendFaceMessage
(
String
clerkId
,
String
memberName
,
String
arrivalTime
,
String
pageUrl
);
Boolean
sendFaceMessage
(
String
clerkId
,
String
memberId
,
String
memberName
,
String
arrivalTime
);
/**
* 发送完善标签信息
* @param clerkId
* @param clerkId
* @param memberName
* @param customerTime
* @param orderId
*/
Boolean
sendPerfectRemarkMessage
(
String
clerkId
,
String
memberId
,
String
memberName
,
String
customerTime
,
String
orderId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
0bc4ca04
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GlobalInfo
;
...
...
@@ -19,6 +20,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.enums.AppPageType
;
import
com.gic.haoban.manage.api.enums.GicDataType
;
import
com.gic.haoban.manage.api.enums.GicEditType
;
import
com.gic.haoban.manage.api.enums.WxEditType
;
...
...
@@ -26,6 +28,7 @@ import com.gic.haoban.manage.api.service.DepartmentApiService;
import
com.gic.haoban.manage.api.service.MessageApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.service.*
;
...
...
@@ -40,7 +43,10 @@ import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -97,6 +103,9 @@ public class MessageApiServiceImpl implements MessageApiService {
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Override
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
...
...
@@ -510,7 +519,11 @@ public class MessageApiServiceImpl implements MessageApiService {
}
@Override
public
Boolean
sendFaceMessage
(
String
clerkId
,
String
memberName
,
String
arrivalTime
,
String
pageUrl
)
{
public
Boolean
sendFaceMessage
(
String
clerkId
,
String
memberId
,
String
memberName
,
String
arrivalTime
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"memberId"
,
memberId
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
FACE_ARRIVAL
.
getCode
(),
data
);
StaffClerkRelationDTO
relation
=
staffClerkRelationApiService
.
getByClerkId
(
clerkId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseService
.
selectById
(
relation
.
getWxEnterpriseId
());
if
(
wxEnterprise
==
null
){
...
...
@@ -520,19 +533,11 @@ public class MessageApiServiceImpl implements MessageApiService {
if
(
relation
!=
null
){
String
userId
=
relation
.
getWxUserId
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
List
<
ItemDTO
>
items
=
new
ArrayList
();;
ItemDTO
dto1
=
new
ItemDTO
();
ItemDTO
dto2
=
new
ItemDTO
();
ItemDTO
dto3
=
new
ItemDTO
();
dto1
.
setKey
(
"事件"
);
dto1
.
setValue
(
"人脸匹配"
);
dto2
.
setKey
(
"会员"
);
dto2
.
setValue
(
memberName
);
dto3
.
setKey
(
"到店时间"
);
dto3
.
setValue
(
arrivalTime
);
items
.
add
(
dto1
);
items
.
add
(
dto2
);
items
.
add
(
dto3
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"事件"
,
"人脸匹配"
);
map
.
put
(
"会员"
,
memberName
);
map
.
put
(
"到店时间"
,
arrivalTime
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
...
...
@@ -548,7 +553,19 @@ public class MessageApiServiceImpl implements MessageApiService {
}
public
static
void
main
(
String
[]
args
){
private
List
<
ItemDTO
>
getItemsList
(
Map
<
String
,
String
>
map
)
{
List
<
ItemDTO
>
items
=
new
ArrayList
();
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
String
key
=
it
.
next
();
String
value
=
map
.
get
(
key
);
ItemDTO
dto
=
new
ItemDTO
();
items
.
add
(
dto
);
}
return
items
;
}
public
static
void
main
(
String
[]
args
){
String
parentChain
=
"1_"
;
String
[]
arr
=
parentChain
.
split
(
"_"
);
int
len
=
arr
.
length
;
...
...
@@ -558,4 +575,41 @@ public class MessageApiServiceImpl implements MessageApiService {
System
.
out
.
println
(
i
);
}
}
@Override
public
Boolean
sendPerfectRemarkMessage
(
String
clerkId
,
String
memberId
,
String
memberName
,
String
customerTime
,
String
orderId
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"memberId"
,
memberId
);
jsonObject
.
put
(
"currentTab"
,
2
);
String
data
=
jsonObject
.
toJSONString
();
String
pageUrl
=
staffDepartmentRelatedApiService
.
getPageUrl
(
AppPageType
.
FACE_ARRIVAL
.
getCode
(),
data
);
StaffClerkRelationDTO
relation
=
staffClerkRelationApiService
.
getByClerkId
(
clerkId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseService
.
selectById
(
relation
.
getWxEnterpriseId
());
if
(
wxEnterprise
==
null
){
log
.
info
(
"企业为空"
);
return
false
;
}
if
(
relation
!=
null
){
String
userId
=
relation
.
getWxUserId
();
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"事件"
,
"会员完善标签"
);
map
.
put
(
"会员"
,
memberName
);
map
.
put
(
"消费订单"
,
orderId
);
map
.
put
(
"消费时间"
,
customerTime
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setTitle
(
"我的顾客通知"
);
messageDTO
.
setItems
(
items
);
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
wxEnterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
messageDTO
);
return
b
;
}
return
false
;
}
}
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