Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
13c4e991
Commit
13c4e991
authored
Aug 02, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改7月封板bug
parent
7de8449a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
12 deletions
+103
-12
WXGroupLearningReportListener.java
...m/pcloud/book/mq/topic/WXGroupLearningReportListener.java
+5
-0
PushBizImpl.java
.../main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
+70
-12
PushItemDao.java
...k/src/main/java/com/pcloud/book/push/dao/PushItemDao.java
+5
-0
PushItemDaoImpl.java
...n/java/com/pcloud/book/push/dao/impl/PushItemDaoImpl.java
+8
-0
PushItemMapper.xml
...ce-book/src/main/resources/mapper/push/PushItemMapper.xml
+15
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WXGroupLearningReportListener.java
View file @
13c4e991
...
...
@@ -14,6 +14,7 @@ import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.QrcodeUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
...
...
@@ -108,6 +109,10 @@ public class WXGroupLearningReportListener {
LOGGER
.
info
(
"发送文字消息开始"
+
sendTextMessageVO
.
toString
());
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
LOGGER
.
info
(
"发送文字消息结束"
+
sendTextMessageVO
.
toString
());
if
(
ListUtils
.
isEmpty
(
learningScoreDTOS
))
{
LOGGER
.
info
(
"没有排行记录,不发送图片groupQrcodeId="
+
groupQrcodeId
);
return
;
}
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
sendPicMessageVO
.
setPicUrl
(
imageUrl
);
sendPicMessageVO
.
setGroupId
(
wechatGroupId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
View file @
13c4e991
...
...
@@ -443,18 +443,8 @@ public class PushBizImpl implements PushBiz {
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"未找到该群发!"
);
}
pushDao
.
update
(
push
);
//删除之前的关联表
pushGroupDao
.
deleteByPushId
(
push
.
getId
(),
push
.
getUpdateUser
());
//填充关联模型字段
fillPushGroupParam
(
push
);
//插入新纪录
pushGroupDao
.
batchInsert
(
push
.
getPushGroups
());
//删除之前的群发消息项
pushItemDao
.
deleteByPushId
(
push
.
getId
(),
push
.
getUpdateUser
());
//填充消息项模型
fillPushItemParam
(
push
);
//插入群发消息项
pushItemDao
.
batchInsert
(
push
.
getPushItems
());
dealUpdatePushGroup
(
push
);
dealUpdatePushItem
(
push
);
//判断是否需要删除群发定时任务
if
(
isNeedupdatepushSchedule
(
pushOld
,
push
))
{
//删除之前的群发定时任务,重新设置群发
...
...
@@ -463,6 +453,74 @@ public class PushBizImpl implements PushBiz {
}
}
@ParamLog
(
"处理更新关联表"
)
private
void
dealUpdatePushGroup
(
Push
push
)
{
List
<
PushGroup
>
pushGroupsOld
=
pushGroupDao
.
getListByPushId
(
push
.
getId
());
List
<
Long
>
pushGroupIdToDelete
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
pushGroupsOld
))
{
pushGroupIdToDelete
=
pushGroupsOld
.
stream
().
map
(
PushGroup:
:
getId
).
collect
(
Collectors
.
toList
());
}
List
<
PushGroup
>
pushGroups
=
push
.
getPushGroups
();
List
<
PushGroup
>
pushGroupsToAdd
=
new
ArrayList
<>();
List
<
Long
>
pushGroupIdToUpdate
=
new
ArrayList
<>();
for
(
PushGroup
pushGroup
:
pushGroups
)
{
if
(
pushGroup
.
getId
()
!=
null
)
{
//更新
pushGroup
.
setUpdateUser
(
push
.
getUpdateUser
());
pushGroupDao
.
update
(
pushGroup
);
pushGroupIdToUpdate
.
add
(
pushGroup
.
getId
());
}
else
{
//新增
pushGroupsToAdd
.
add
(
pushGroup
);
}
}
if
(!
ListUtils
.
isEmpty
(
pushGroupIdToUpdate
))
{
pushGroupIdToDelete
.
removeAll
(
pushGroupIdToUpdate
);
}
if
(!
ListUtils
.
isEmpty
(
pushGroupsToAdd
))
{
//填充关联模型字段
fillPushGroupParam
(
push
);
pushGroupDao
.
batchInsert
(
pushGroupsToAdd
);
}
if
(!
ListUtils
.
isEmpty
(
pushGroupIdToDelete
))
{
pushGroupDao
.
deleteByIds
(
pushGroupIdToDelete
,
push
.
getUpdateUser
());
}
}
@ParamLog
(
"处理更新关联表"
)
private
void
dealUpdatePushItem
(
Push
push
)
{
List
<
PushItem
>
pushItemsOld
=
pushItemDao
.
getListByPushId
(
push
.
getId
());
List
<
Long
>
pushItemIdsToDelete
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
pushItemsOld
))
{
pushItemIdsToDelete
=
pushItemsOld
.
stream
().
map
(
PushItem:
:
getId
).
collect
(
Collectors
.
toList
());
}
List
<
PushItem
>
pushItems
=
push
.
getPushItems
();
List
<
PushItem
>
pushItemsToAdd
=
new
ArrayList
<>();
List
<
Long
>
pushItemIdToUpdate
=
new
ArrayList
<>();
for
(
PushItem
pushItem
:
pushItems
)
{
if
(
pushItem
.
getId
()
!=
null
)
{
//更新
pushItem
.
setUpdateUser
(
push
.
getUpdateUser
());
pushItemDao
.
update
(
pushItem
);
pushItemIdToUpdate
.
add
(
pushItem
.
getId
());
}
else
{
//新增
pushItemsToAdd
.
add
(
pushItem
);
}
}
if
(!
ListUtils
.
isEmpty
(
pushItemIdToUpdate
))
{
pushItemIdsToDelete
.
removeAll
(
pushItemIdToUpdate
);
}
if
(!
ListUtils
.
isEmpty
(
pushItemsToAdd
))
{
//填充关联模型字段
fillPushItemParam
(
push
);
pushItemDao
.
batchInsert
(
pushItemsToAdd
);
}
if
(!
ListUtils
.
isEmpty
(
pushItemIdsToDelete
))
{
pushItemDao
.
deleteByIds
(
pushItemIdsToDelete
,
push
.
getUpdateUser
());
}
}
/**
* 删除群发定时任务
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/PushItemDao.java
View file @
13c4e991
...
...
@@ -71,4 +71,9 @@ public interface PushItemDao extends BaseDao<PushItem> {
* @return
*/
List
<
PushItem
>
getAllListByPushIds
(
List
<
Long
>
pushIds
);
/**
* 根据id集合删除
*/
void
deleteByIds
(
List
<
Long
>
ids
,
Long
partyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/impl/PushItemDaoImpl.java
View file @
13c4e991
...
...
@@ -73,4 +73,12 @@ public class PushItemDaoImpl extends BaseDaoImpl<PushItem> implements PushItemDa
map
.
put
(
"pushIds"
,
pushIds
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getAllListByPushIds"
),
map
);
}
@Override
public
void
deleteByIds
(
List
<
Long
>
ids
,
Long
partyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"ids"
,
ids
);
map
.
put
(
"partyId"
,
partyId
);
super
.
getSqlSession
().
update
(
getStatement
(
"deleteByIds"
),
map
);
}
}
pcloud-service-book/src/main/resources/mapper/push/PushItemMapper.xml
View file @
13c4e991
...
...
@@ -259,4 +259,18 @@
</foreach>
order by push_id asc, seq_num asc
</select>
<!--批量删除-->
<update
id=
"deleteByIds"
parameterType=
"map"
>
UPDATE
push_item
SET is_delete = 1,
update_user = #{partyId},
update_time = now()
WHERE id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</update>
</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