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
27633689
Commit
27633689
authored
Jul 17, 2025
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/xgh/202507迭代' into 'developer'
任务提醒 See merge request
!3093
parents
fc956c20
3d201750
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
18 deletions
+69
-18
HaobanTaskNoticeMapper.java
...ban/manage/service/dao/mapper/HaobanTaskNoticeMapper.java
+3
-0
HaobanCommonMQApiServiceImpl.java
...ervice/service/out/impl/HaobanCommonMQApiServiceImpl.java
+14
-0
HaobanTaskNoticeApiServiceImpl.java
...vice/service/out/impl/HaobanTaskNoticeApiServiceImpl.java
+47
-18
TaskNoticeMapper.xml
...e3-service/src/main/resources/mapper/TaskNoticeMapper.xml
+5
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/HaobanTaskNoticeMapper.java
View file @
27633689
...
...
@@ -4,6 +4,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanTaskNotice;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
@Mapper
...
...
@@ -16,4 +17,6 @@ public interface HaobanTaskNoticeMapper {
List
<
TabHaobanTaskNotice
>
listForTimer
()
;
TabHaobanTaskNotice
getById
(
@Param
(
"id"
)
Long
id
);
int
listByPlanId
(
@Param
(
"planId"
)
String
planId
,
@Param
(
"startTime"
)
Date
startTime
,
@Param
(
"endTime"
)
Date
endTime
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/HaobanCommonMQApiServiceImpl.java
View file @
27633689
...
...
@@ -17,6 +17,8 @@ import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanService
;
import
com.gic.haoban.manage.service.service.role.HaobanMenuService
;
import
com.gic.haoban.manage.service.util.EventUtils
;
import
com.gic.haoban.task.api.service.TelTaskApiService
;
import
com.gic.haoban.task.manage.api.service.QywxGroupSendCanvasApiService
;
import
com.gic.member.api.dto.MemberInfoChangeNotifyDTO
;
import
com.gic.member.api.dto.event.wechat.WeChatOfficialAccountEventParam
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -70,6 +72,10 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
private
QwMomentPlanAttendService
qwMomentPlanAttendService
;
@Autowired
private
GroupChatService
groupChatService
;
@Autowired
private
QywxGroupSendCanvasApiService
qywxGroupSendCanvasApiService
;
@Autowired
private
TelTaskApiService
telTaskApiService
;
@Override
public
void
putCommonMessage
(
CommonMQDTO
dto
)
{
...
...
@@ -191,6 +197,14 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
Long
momentPlanId12
=
Long
.
valueOf
(
map
.
get
(
"planId"
))
;
this
.
qwMomentPlanService
.
cancelQw
(
momentPlanId12
);
break
;
case
20
:
String
massNotice
=
map
.
get
(
"id"
)
;
this
.
qywxGroupSendCanvasApiService
.
notice
(
massNotice
);
break
;
case
21
:
String
telNotice
=
map
.
get
(
"id"
)
;
this
.
telTaskApiService
.
notice
(
telNotice
);
break
;
default
:
break
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/HaobanTaskNoticeApiServiceImpl.java
View file @
27633689
...
...
@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.CommonMQDTO
;
import
com.gic.haoban.manage.api.dto.HaobanTaskNoticeDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.service.HaobanCommonMQApiService
;
import
com.gic.haoban.manage.api.service.HaobanTaskNoticeApiService
;
import
com.gic.haoban.manage.service.dao.mapper.HaobanTaskNoticeMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
...
...
@@ -25,8 +28,7 @@ import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog;
import
com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatPlanService
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.ItemDTO
;
import
com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
...
...
@@ -35,9 +37,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
(
"haobanTaskNoticeApiService"
)
...
...
@@ -65,12 +65,30 @@ public class HaobanTaskNoticeApiServiceImpl implements HaobanTaskNoticeApiServic
private
GroupChatPlanMapper
groupChatPlanMapper
;
@Autowired
private
GroupChatPlanOwnerLogMapper
groupChatPlanOwnerLogMapper
;
@Autowired
private
HaobanCommonMQApiService
haobanCommonMQApiService
;
int
maxNum
=
10
;
@Override
public
ServiceResponse
<
Void
>
save
(
HaobanTaskNoticeDTO
notice
)
{
TabHaobanTaskNotice
entity
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanTaskNotice
.
class
,
notice
)
;
entity
.
setId
(
UniqueIdUtils
.
uniqueLong
());
this
.
haobanTaskNoticeMapper
.
save
(
entity
)
;
Date
start
=
DateUtil
.
getStartTimeOfDay
()
;
Date
end
=
DateUtil
.
getEndTimeOfDay
()
;
int
num
=
this
.
haobanTaskNoticeMapper
.
listByPlanId
(
notice
.
getPlanId
(),
start
,
end
)
;
if
(
num
>=
maxNum
)
{
return
ServiceResponse
.
failure
(
"00001"
,
"执行次数超过最大限制"
);
}
String
key
=
"hbNotice"
+
notice
.
getPlanId
()
;
RedisUtil
.
lock
(
key
,
3L
);
try
{
if
(
num
+
1
>=
maxNum
)
{
return
ServiceResponse
.
failure
(
"00001"
,
"执行次数超过最大限制"
);
}
TabHaobanTaskNotice
entity
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanTaskNotice
.
class
,
notice
)
;
entity
.
setId
(
UniqueIdUtils
.
uniqueLong
());
this
.
haobanTaskNoticeMapper
.
save
(
entity
)
;
}
finally
{
RedisUtil
.
unlock
(
key
);
}
return
ServiceResponse
.
success
();
}
...
...
@@ -86,14 +104,31 @@ public class HaobanTaskNoticeApiServiceImpl implements HaobanTaskNoticeApiServic
@Override
public
ServiceResponse
<
Void
>
sendTimer
(
String
params
)
{
List
<
TabHaobanTaskNotice
>
noticeList
=
this
.
haobanTaskNoticeMapper
.
listForTimer
()
;
Set
<
String
>
planIdSet
=
new
HashSet
<>()
;
if
(
CollectionUtils
.
isNotEmpty
(
noticeList
))
{
this
.
haobanTaskNoticeMapper
.
updateStatus
(
noticeList
.
stream
().
map
(
o
->
o
.
getId
()).
collect
(
Collectors
.
toList
()))
;
for
(
TabHaobanTaskNotice
notice
:
noticeList
)
{
if
(
notice
.
getPlanType
()==
3
)
{
this
.
chatSend
(
notice
)
;
if
(
planIdSet
.
contains
(
notice
.
getPlanId
())
)
{
continue
;
}
if
(
notice
.
getPlanType
()==
4
)
{
planIdSet
.
add
(
notice
.
getPlanId
())
;
if
(
notice
.
getPlanType
()==
1
)
{
CommonMQDTO
dto
=
new
CommonMQDTO
();
dto
.
setType
(
20
);
Map
<
String
,
String
>
map
=
new
HashMap
<>()
;
map
.
put
(
"id"
,
notice
.
getPlanId
())
;
dto
.
setParams
(
map
);
this
.
haobanCommonMQApiService
.
putCommonMessage
(
dto
);
}
else
if
(
notice
.
getPlanType
()==
2
)
{
CommonMQDTO
dto
=
new
CommonMQDTO
();
dto
.
setType
(
21
);
Map
<
String
,
String
>
map
=
new
HashMap
<>()
;
map
.
put
(
"id"
,
notice
.
getPlanId
())
;
dto
.
setParams
(
map
);
this
.
haobanCommonMQApiService
.
putCommonMessage
(
dto
);
}
else
if
(
notice
.
getPlanType
()==
3
)
{
this
.
chatSend
(
notice
);
}
else
if
(
notice
.
getPlanType
()==
4
)
{
this
.
momentSend
(
notice
);
}
}
...
...
@@ -179,12 +214,6 @@ public class HaobanTaskNoticeApiServiceImpl implements HaobanTaskNoticeApiServic
List
<
ItemDTO
>
items
=
new
ArrayList
<>()
;
ItemDTO
paramItem1
=
new
ItemDTO
();
paramItem1
.
setKey
(
"任务类型"
);
if
(
notice
.
getPlanType
()==
1
)
{
paramItem1
.
setValue
(
"客户群发"
);
}
if
(
notice
.
getPlanType
()==
2
)
{
paramItem1
.
setValue
(
"话务任务"
);
}
if
(
notice
.
getPlanType
()==
3
)
{
paramItem1
.
setValue
(
"社群群发"
);
}
...
...
haoban-manage3-service/src/main/resources/mapper/TaskNoticeMapper.xml
View file @
27633689
...
...
@@ -70,4 +70,8 @@
FROM tab_haoban_task_notice WHERE id = #{id}
</select>
<select
id=
"listByPlanId"
resultType=
"java.lang.Integer"
>
select count(*) from tab_haoban_task_notice where plan_id = #{planId} and create_time >= #{startTime} and create_time
<![CDATA[ <= ]]>
#{endTime}
</select>
</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