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
b4bea1c1
Commit
b4bea1c1
authored
Mar 31, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口优化/book/v1.0/selfPushFacade/listSelfPushRecord
parent
f8c2fae6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
7 deletions
+92
-7
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+19
-4
SelfPushDao.java
...k/src/main/java/com/pcloud/book/push/dao/SelfPushDao.java
+7
-0
SelfPushDaoImpl.java
...n/java/com/pcloud/book/push/dao/impl/SelfPushDaoImpl.java
+10
-0
SelfPush.java
...k/src/main/java/com/pcloud/book/push/entity/SelfPush.java
+3
-0
SelfPushMapper.xml
...ce-book/src/main/resources/mapper/push/SelfPushMapper.xml
+53
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
b4bea1c1
...
@@ -148,11 +148,13 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -148,11 +148,13 @@ public class SelfPushBizImpl implements SelfPushBiz {
selfPush
.
setSendNow
(
sendNow
);
selfPush
.
setSendNow
(
sendNow
);
if
(
sendNow
)
{
if
(
sendNow
)
{
selfPush
.
setSendTime
(
new
Date
());
selfPush
.
setSendTime
(
new
Date
());
selfPush
.
setPushStatus
(
PushStatusEnum
.
PUSHING
.
value
);
}
else
{
}
else
{
selfPush
.
setPushSendTime
(
addParamDTO
.
getSendTime
());
selfPush
.
setPushSendTime
(
addParamDTO
.
getSendTime
());
selfPush
.
setStartTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getStartTime
()));
selfPush
.
setStartTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getStartTime
()));
selfPush
.
setEndTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getEndTime
()));
selfPush
.
setEndTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getEndTime
()));
selfPush
.
setPushType
(
addParamDTO
.
getPushType
());
selfPush
.
setPushType
(
addParamDTO
.
getPushType
());
selfPush
.
setPushStatus
(
PushStatusEnum
.
WAIT
.
value
);
if
(
addParamDTO
.
getPushType
()==
2
){
if
(
addParamDTO
.
getPushType
()==
2
){
selfPush
.
setWeekDays
(
addParamDTO
.
getWeekDays
());
selfPush
.
setWeekDays
(
addParamDTO
.
getWeekDays
());
}
}
...
@@ -336,7 +338,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -336,7 +338,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
}
}
}
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
this
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
});
});
}
else
if
(
null
!=
selfPush
.
getBookGroupId
()){
//编辑端群发
}
else
if
(
null
!=
selfPush
.
getBookGroupId
()){
//编辑端群发
Long
bookGroupId
=
selfPush
.
getBookGroupId
();
Long
bookGroupId
=
selfPush
.
getBookGroupId
();
...
@@ -362,7 +364,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -362,7 +364,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
}
}
}
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
this
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
});
});
}
}
...
@@ -663,7 +665,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -663,7 +665,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
map
.
put
(
"endTime"
,
endTime
);
map
.
put
(
"endTime"
,
endTime
);
map
.
put
(
"pushStatus"
,
status
);
map
.
put
(
"pushStatus"
,
status
);
map
.
put
(
"partyId"
,
partyId
);
map
.
put
(
"partyId"
,
partyId
);
PageBeanNew
<
SelfPushRecordDTO
>
pageBeanNew
=
selfPush
ItemDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listSelfPushRecord
"
);
PageBeanNew
<
SelfPushRecordDTO
>
pageBeanNew
=
selfPush
Dao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listSelfPush
"
);
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
}
...
@@ -750,10 +752,12 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -750,10 +752,12 @@ public class SelfPushBizImpl implements SelfPushBiz {
realSendTime
=
realSendTime
+
weekDays
+
";"
+
dto
.
getPushSendTime
();
realSendTime
=
realSendTime
+
weekDays
+
";"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
dto
.
setRealSendTime
(
realSendTime
);
}
else
{
}
else
{
if
(
null
!=
dto
.
getSendTime
()){
dto
.
setRealSendTime
(
DateUtils
.
formatDate
(
dto
.
getSendTime
(),
"yyyy-MM-dd HH:mm:ss"
));
dto
.
setRealSendTime
(
DateUtils
.
formatDate
(
dto
.
getSendTime
(),
"yyyy-MM-dd HH:mm:ss"
));
}
}
}
}
}
}
}
private
void
fillPushItemsAndBookName
(
List
<
SelfPushRecordDTO
>
recordList
)
{
private
void
fillPushItemsAndBookName
(
List
<
SelfPushRecordDTO
>
recordList
)
{
List
<
Long
>
pushIds
=
new
ArrayList
<>();
List
<
Long
>
pushIds
=
new
ArrayList
<>();
...
@@ -874,7 +878,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -874,7 +878,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
ListUtils
.
isEmpty
(
userIdList
)
||
ListUtils
.
isEmpty
(
itemList
))
{
if
(
ListUtils
.
isEmpty
(
userIdList
)
||
ListUtils
.
isEmpty
(
itemList
))
{
return
;
return
;
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
PUSHING
.
value
,
pushId
);
this
.
updatePushStatusByPushId
(
PushStatusEnum
.
PUSHING
.
value
,
pushId
);
msgPush
(
userIdList
,
itemList
,
pushId
);
msgPush
(
userIdList
,
itemList
,
pushId
);
}
}
...
@@ -1090,4 +1094,15 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -1090,4 +1094,15 @@ public class SelfPushBizImpl implements SelfPushBiz {
public
PersonalApplets
getAppletsById
(
Long
id
)
{
public
PersonalApplets
getAppletsById
(
Long
id
)
{
return
personalAppletsDao
.
getById
(
id
);
return
personalAppletsDao
.
getById
(
id
);
}
}
/**
* 更新发送状态
* @param pushStatus
* @param pushId
*/
public
void
updatePushStatusByPushId
(
Integer
pushStatus
,
Long
pushId
){
selfPushItemDao
.
updatePushStatusByPushId
(
pushStatus
,
pushId
);
selfPushDao
.
updatePushStatusById
(
pushStatus
,
pushId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/SelfPushDao.java
View file @
b4bea1c1
...
@@ -14,4 +14,11 @@ import java.util.List;
...
@@ -14,4 +14,11 @@ import java.util.List;
public
interface
SelfPushDao
extends
BaseDao
<
SelfPush
>{
public
interface
SelfPushDao
extends
BaseDao
<
SelfPush
>{
List
<
SelfPush
>
getUnclosedByRobot
(
String
altId
);
List
<
SelfPush
>
getUnclosedByRobot
(
String
altId
);
/**
* 更新发送状态
* @param pushStatus
* @param id
*/
void
updatePushStatusById
(
Integer
pushStatus
,
Long
id
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/impl/SelfPushDaoImpl.java
View file @
b4bea1c1
...
@@ -6,7 +6,9 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
...
@@ -6,7 +6,9 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:个人号群发
* @描述:个人号群发
...
@@ -20,4 +22,12 @@ public class SelfPushDaoImpl extends BaseDaoImpl<SelfPush> implements SelfPushDa
...
@@ -20,4 +22,12 @@ public class SelfPushDaoImpl extends BaseDaoImpl<SelfPush> implements SelfPushDa
public
List
<
SelfPush
>
getUnclosedByRobot
(
String
altId
)
{
public
List
<
SelfPush
>
getUnclosedByRobot
(
String
altId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getUnclosedByRobot"
),
altId
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getUnclosedByRobot"
),
altId
);
}
}
@Override
public
void
updatePushStatusById
(
Integer
pushStatus
,
Long
id
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pushStatus"
,
pushStatus
);
map
.
put
(
"id"
,
id
);
getSessionTemplate
().
update
(
getStatement
(
"updatePushStatusById"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/SelfPush.java
View file @
b4bea1c1
...
@@ -72,4 +72,6 @@ public class SelfPush extends BaseEntity{
...
@@ -72,4 +72,6 @@ public class SelfPush extends BaseEntity{
@ApiModelProperty
(
"个人号类型(1微信2QQ)"
)
@ApiModelProperty
(
"个人号类型(1微信2QQ)"
)
private
Integer
altType
;
private
Integer
altType
;
@ApiModelProperty
(
"发送状态(0发送中1发送成功2发送失败)"
)
private
Integer
pushStatus
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/push/SelfPushMapper.xml
View file @
b4bea1c1
...
@@ -18,22 +18,23 @@
...
@@ -18,22 +18,23 @@
<result
column=
"week_days"
property=
"weekDays"
jdbcType=
"VARCHAR"
/>
<result
column=
"week_days"
property=
"weekDays"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_send_time"
property=
"pushSendTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_send_time"
property=
"pushSendTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"alt_type"
property=
"altType"
jdbcType=
"INTEGER"
/>
<result
column=
"alt_type"
property=
"altType"
jdbcType=
"INTEGER"
/>
<result
column=
"push_status"
property=
"pushStatus"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, alt_id, create_user, create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
id, alt_id, create_user, create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
push_type,week_days,push_send_time,alt_type
push_type,week_days,push_send_time,alt_type
, push_status
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPush"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPush"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_push (id, alt_id, create_user,
insert into self_push (id, alt_id, create_user,
create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
push_type,week_days,push_send_time,alt_type
push_type,week_days,push_send_time,alt_type
,push_status
)
)
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}, #{bookGroupId}, #{sendAll},#{startTime},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}, #{bookGroupId}, #{sendAll},#{startTime},
#{endTime},#{pushType},#{weekDays},#{pushSendTime}, #{altType}
#{endTime},#{pushType},#{weekDays},#{pushSendTime}, #{altType}
,#{pushStatus,jdbcType=INTEGER}
)
)
</insert>
</insert>
...
@@ -65,4 +66,52 @@
...
@@ -65,4 +66,52 @@
)
)
AND alt_id = #{altId}
AND alt_id = #{altId}
</select>
</select>
<update
id=
"updatePushStatusById"
parameterType=
"map"
>
UPDATE self_push
SET push_status = #{pushStatus}
WHERE id= #{id}
</update>
<select
id=
"listSelfPush"
parameterType=
"map"
resultType=
"com.pcloud.book.push.dto.SelfPushRecordDTO"
>
SELECT
p.alt_id altId,
p.book_group_id bookGroupId,
p.id pushId,
p.send_all sendAll,
p.create_user createUser,
p.start_time startTime,
p.end_time endTime,
p.push_send_time pushSendTime,
p.week_days weekDays,
p.push_type pushType,
p.alt_type groupRobotType,
p.push_status pushStatus,
p.create_time createTime,
p.send_time sendTime
FROM
self_push p
WHERE
1 = 1
<if
test=
"startTime != null and endTime != null"
>
AND (
(p.send_time BETWEEN #{startTime} AND #{endTime} )
OR (p.start_time >= #{startTime} AND p.end_time
<
= #{endTime})
)
</if>
<if
test=
"pushStatus != null"
>
AND p.push_status = #{pushStatus}
</if>
<choose>
<when
test=
"partyId == 0"
>
AND p.alt_id IS NOT NULL AND p.alt_id !=""
</when>
<otherwise>
AND p.create_user = #{partyId}
</otherwise>
</choose>
ORDER BY
p.create_time DESC
</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