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
bdb362e5
Commit
bdb362e5
authored
Mar 14, 2023
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办消息通知
parent
35055d63
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
192 additions
and
4 deletions
+192
-4
NotifyMessageMQDTO.java
.../haoban/manage/api/dto/notify/dto/NotifyMessageMQDTO.java
+66
-0
NoticeMessageQDTO.java
.../haoban/manage/api/dto/notify/qdto/NoticeMessageQDTO.java
+10
-0
NotifyMessageBatchQDTO.java
...an/manage/api/dto/notify/qdto/NotifyMessageBatchQDTO.java
+22
-0
NoticeMessageCategoryTypeEnum.java
...aoban/manage/api/enums/NoticeMessageCategoryTypeEnum.java
+1
-0
NoticeMessageTypeEnum.java
...om/gic/haoban/manage/api/enums/NoticeMessageTypeEnum.java
+4
-0
MessageApiService.java
.../com/gic/haoban/manage/api/service/MessageApiService.java
+2
-0
NoticeMessageApiService.java
...an/manage/api/service/notify/NoticeMessageApiService.java
+17
-0
NoticeMessageMQApiService.java
.../manage/api/service/notify/NoticeMessageMQApiService.java
+12
-0
NoticeMessageUtil.java
.../gic/haoban/manage/api/util/notify/NoticeMessageUtil.java
+2
-0
NoticeMessageMapper.java
...haoban/manage/service/dao/mapper/NoticeMessageMapper.java
+2
-0
NoticeMessageService.java
...n/manage/service/service/notify/NoticeMessageService.java
+4
-0
NoticeMessageServiceImpl.java
...service/service/notify/impl/NoticeMessageServiceImpl.java
+15
-0
NoticeMessageApiServiceImpl.java
...rvice/service/notify/out/NoticeMessageApiServiceImpl.java
+0
-0
NoticeMessageMapper.xml
...service/src/main/resources/mapper/NoticeMessageMapper.xml
+15
-0
DealSyncTest.java
haoban-manage3-service/src/test/java/DealSyncTest.java
+0
-4
NotityTest.java
haoban-manage3-service/src/test/java/NotityTest.java
+20
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/notify/dto/NotifyMessageMQDTO.java
0 → 100644
View file @
bdb362e5
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
notify
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by wangzubo on 2023/3/13.
*/
public
class
NotifyMessageMQDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 导购id列表
*/
private
List
<
String
>
clerkIdList
;
/**
* 通知类型
*/
private
String
templateCode
;
/**
* 拓展内容
*/
private
Map
<
String
,
Object
>
extendContent
;
/**
* 结果 1成功0失败
*/
private
Integer
result
;
public
List
<
String
>
getClerkIdList
()
{
return
clerkIdList
;
}
public
void
setClerkIdList
(
List
<
String
>
clerkIdList
)
{
this
.
clerkIdList
=
clerkIdList
;
}
public
String
getTemplateCode
()
{
return
templateCode
;
}
public
void
setTemplateCode
(
String
templateCode
)
{
this
.
templateCode
=
templateCode
;
}
public
Map
<
String
,
Object
>
getExtendContent
()
{
return
extendContent
;
}
public
void
setExtendContent
(
Map
<
String
,
Object
>
extendContent
)
{
this
.
extendContent
=
extendContent
;
}
public
Integer
getResult
()
{
return
result
;
}
public
void
setResult
(
Integer
result
)
{
this
.
result
=
result
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/notify/qdto/NoticeMessageQDTO.java
View file @
bdb362e5
...
...
@@ -16,6 +16,8 @@ public class NoticeMessageQDTO implements Serializable {
private
String
optTargetId
;
private
int
messageType
;
private
String
templateCode
;
private
String
title
;
private
Map
<
String
,
String
>
contentMap
;
public
NoticeMessageQDTO
()
{
...
...
@@ -109,6 +111,14 @@ public class NoticeMessageQDTO implements Serializable {
this
.
templateCode
=
templateCode
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Map
<
String
,
String
>
getContentMap
()
{
return
contentMap
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/notify/qdto/NotifyMessageBatchQDTO.java
0 → 100644
View file @
bdb362e5
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
notify
.
qdto
;
import
java.util.List
;
/**
* Created by wangzubo on 2023/3/13.
*/
public
class
NotifyMessageBatchQDTO
extends
NoticeMessageQDTO
{
private
static
final
long
serialVersionUID
=
1L
;
private
List
<
String
>
storeIdList
;
public
List
<
String
>
getStoreIdList
()
{
return
storeIdList
;
}
public
void
setStoreIdList
(
List
<
String
>
storeIdList
)
{
this
.
storeIdList
=
storeIdList
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/NoticeMessageCategoryTypeEnum.java
View file @
bdb362e5
...
...
@@ -10,6 +10,7 @@ public enum NoticeMessageCategoryTypeEnum {
CUSTOMER
(
0
,
"客户相关"
),
TASK
(
1
,
"任务相关"
),
ACTIVITY
(
2
,
"活动相关"
),
MATERIAL
(
4
,
"素材相关"
),
OTHER
(
3
,
"其它"
),;
private
int
type
;
private
String
name
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/NoticeMessageTypeEnum.java
View file @
bdb362e5
...
...
@@ -57,6 +57,10 @@ public enum NoticeMessageTypeEnum {
CUSTOMER_GET_COUPON
(
4004
,
"客户领券通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_get_coupon"
,
"/pages/route/index?pageType="
,
"hbapp_customer_detail"
),
CUSTOMER_APPLY_ORDER_REFUND
(
4005
,
"客户申请退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_apply_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_customer_order_detail"
),
CUSTOMER_SUCCESS_ORDER_REFUND
(
4006
,
"客户成功退单通知"
,
NoticeMessageCategoryTypeEnum
.
CUSTOMER
.
getType
(),
"customer_success_order_refund"
,
"/pages/route/index?pageType="
,
"hbapp_user_bill_detail"
),
// todo pageType
MATERIAL_NEW_NOTIFY
(
5001
,
"素材上新通知"
,
NoticeMessageCategoryTypeEnum
.
MATERIAL
.
getType
(),
"material_new_notify"
,
"/pages/route/index?pageType="
,
"hbapp_customer_list"
),
;
/**
* 消息类型
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MessageApiService.java
View file @
bdb362e5
...
...
@@ -3,6 +3,8 @@ package com.gic.haoban.manage.api.service;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.QywxCallBackDTO
;
import
java.util.List
;
/**
* Created by tgs on 2020/2/20.
*/
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/notify/NoticeMessageApiService.java
View file @
bdb362e5
...
...
@@ -4,6 +4,9 @@ import com.gic.api.base.commons.BasePageInfo;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
java.util.List
;
/**
* Created 2021/12/17.
...
...
@@ -26,6 +29,20 @@ public interface NoticeMessageApiService {
public
void
run
(
String
json
);
/**
* 消息接收 发送消息
* "routerName": "haobanNoticeMessageBatch"
* @param json
*/
void
noticeMessageBatchMq
(
String
json
);
/**
* 批量发送实现
* @param notifyMessageBatchQDTO
* @return
*/
ServiceResponse
<
Void
>
batchSendMessage
(
NotifyMessageBatchQDTO
notifyMessageBatchQDTO
);
/**
* 消息分页
*1
* @param enterpriseId
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/notify/NoticeMessageMQApiService.java
0 → 100644
View file @
bdb362e5
package
com
.
gic
.
haoban
.
manage
.
api
.
service
.
notify
;
import
com.gic.api.base.commons.ServiceResponse
;
import
java.util.List
;
public
interface
NoticeMessageMQApiService
{
ServiceResponse
<
Void
>
receviceSendMessage
(
String
enterpriseId
,
List
<
String
>
storeIdList
);
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/util/notify/NoticeMessageUtil.java
View file @
bdb362e5
...
...
@@ -26,6 +26,8 @@ public class NoticeMessageUtil {
private
static
final
String
NOTICE_MESSAGE
=
"haobanNoticeMessage"
;
private
static
final
String
NOTICE_MESSAGE_BATCH
=
"haobanNoticeMessageBatch"
;
/**
* 发送消息
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/NoticeMessageMapper.java
View file @
bdb362e5
...
...
@@ -20,6 +20,8 @@ public interface NoticeMessageMapper {
*/
int
insertSelective
(
TabNoticeMessage
record
);
int
insertBatch
(
@Param
(
"records"
)
List
<
TabNoticeMessage
>
record
);
/**
*/
TabNoticeMessage
selectByPrimaryKey
(
Long
noticeMessageId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/NoticeMessageService.java
View file @
bdb362e5
...
...
@@ -5,6 +5,8 @@ import com.gic.api.base.commons.Page;
import
com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO
;
import
com.gic.haoban.manage.service.pojo.bo.PendingTaskBO
;
import
java.util.List
;
/**
* Created 2021/12/15.
*
...
...
@@ -20,6 +22,8 @@ public interface NoticeMessageService {
*/
public
boolean
addOrCreateNoticeMessage
(
NoticeMessageBO
messageBO
);
void
addNoticeMessageBatch
(
List
<
NoticeMessageBO
>
list
);
/**
* 分页查询消息
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/impl/NoticeMessageServiceImpl.java
View file @
bdb362e5
...
...
@@ -11,6 +11,7 @@ import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
import
com.gic.haoban.manage.service.pojo.bo.PendingTaskBO
;
import
com.gic.haoban.manage.service.service.notify.NoticeMessageService
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -43,6 +44,20 @@ public class NoticeMessageServiceImpl implements NoticeMessageService {
}
@Override
public
void
addNoticeMessageBatch
(
List
<
NoticeMessageBO
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
;
}
List
<
TabNoticeMessage
>
noticeMessageList
=
EntityUtil
.
changeEntityListByJSON
(
TabNoticeMessage
.
class
,
list
);
for
(
TabNoticeMessage
noticeMessage
:
noticeMessageList
)
{
noticeMessage
.
setNoticeMessageId
(
UniqueIdUtils
.
uniqueLong
());
noticeMessage
.
setCreateTime
(
new
Date
());
noticeMessage
.
setUpdateTime
(
new
Date
());
}
noticeMessageMapper
.
insertBatch
(
noticeMessageList
);
}
@Override
public
Page
<
NoticeMessageBO
>
pageNoticeMessage
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
int
categoryType
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
);
List
<
TabNoticeMessage
>
list
=
noticeMessageMapper
.
listNoticeMessage
(
enterpriseId
,
storeId
,
clerkId
,
categoryType
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/out/NoticeMessageApiServiceImpl.java
View file @
bdb362e5
This diff is collapsed.
Click to expand it.
haoban-manage3-service/src/main/resources/mapper/NoticeMessageMapper.xml
View file @
bdb362e5
...
...
@@ -47,6 +47,21 @@
#{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertBatch"
>
insert into tab_haoban_notice_message (notice_message_id, enterprise_id, store_id,
clerk_id, category_type, message_type,
template_code, title, description,
relation_id, message_content, create_time, update_time
)
values
<foreach
collection=
"records"
item=
"record"
separator=
","
>
(#{record.noticeMessageId,jdbcType=BIGINT}, #{record.enterpriseId,jdbcType=VARCHAR}, #{record.storeId,jdbcType=VARCHAR},
#{record.clerkId,jdbcType=VARCHAR}, #{record.categoryType,jdbcType=INTEGER}, #{record.messageType,jdbcType=INTEGER},
#{record.templateCode,jdbcType=VARCHAR}, #{record.title,jdbcType=VARCHAR}, #{record.description,jdbcType=VARCHAR},
#{record.relationId,jdbcType=VARCHAR}, #{record.messageContent,jdbcType=VARCHAR}, #{record.createTime,jdbcType=TIMESTAMP}, #{record.updateTime,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabNoticeMessage"
>
insert into tab_haoban_notice_message
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
haoban-manage3-service/src/test/java/DealSyncTest.java
View file @
bdb362e5
...
...
@@ -7,7 +7,6 @@ import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.TestService
;
import
com.gic.wechat.api.dto.qywx.DepartmentDTO
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
...
...
@@ -44,9 +43,6 @@ public class DealSyncTest {
private
QywxDepartmentApiService
qywxDepartmentApiService
;
@Autowired
private
TestService
testService
;
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
...
...
haoban-manage3-service/src/test/java/NotityTest.java
View file @
bdb362e5
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.dto.AlertMessageDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
com.gic.haoban.manage.api.enums.AlertTypeEnum
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.service.CheckQywxSettingApiService
;
import
com.gic.haoban.manage.api.service.QywxTagApiService
;
import
com.gic.haoban.manage.api.service.notify.NoticeMessageApiService
;
import
com.google.common.collect.Lists
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
...
...
@@ -62,4 +64,22 @@ public class NotityTest {
qywxTagApiService
.
checkQywxSync
(
"-1"
);
}
@Test
public
void
batchSendMessage
()
{
NotifyMessageBatchQDTO
qdto
=
new
NotifyMessageBatchQDTO
();
qdto
.
setStoreIdList
(
Lists
.
newArrayList
(
"ff8080817c2b4c55017c30a4482800d7"
));
qdto
.
setOptTargetId
(
"-1"
);
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"materialNotifyId"
,
111
);
qdto
.
setExtendContent
(
map1
);
qdto
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
qdto
.
setMessageType
(
NoticeMessageTypeEnum
.
MATERIAL_NEW_NOTIFY
.
getType
());
qdto
.
setTemplateCode
(
NoticeMessageTypeEnum
.
MATERIAL_NEW_NOTIFY
.
getTemplateCode
());
qdto
.
setTitle
(
"素材上新通知"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"content"
,
"有新的素材了,快来看啊!"
);
qdto
.
setContentMap
(
map
);
noticeMessageApiService
.
batchSendMessage
(
qdto
);
}
}
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