Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e37f68ee
authored
Mar 25, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022.03.23 疫情备份 重复数据处理
1 parent
1f5ea089
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
3 deletions
src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
src/main/java/com/subsidy/mapper/VodDictMapper.java
src/main/java/com/subsidy/service/VodPlayHistoryService.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java
src/main/resources/application.properties
src/main/resources/mapper/VodDictMapper.xml
src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java
View file @
e37f68e
...
...
@@ -64,7 +64,7 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
token
=
authorization
.
replace
(
"Bearer "
,
""
);
}
/*Token不存在*/
if
(
token
==
null
||
JwtUtil
.
isExpired
(
token
)
||
!
JwtUtil
.
verifyToken
(
token
))
{
if
(
token
==
null
||
!
JwtUtil
.
verifyToken
(
token
))
{
throw
new
HttpException
(
1010
);
}
...
...
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
View file @
e37f68e
...
...
@@ -77,4 +77,10 @@ public class VodPlayHistoryController {
vodPlayHistoryService
.
playLengthFix
(
remainSecondsDTO
);
}
@PostMapping
(
"testPlays"
)
public
ResponseVO
testPlays
(){
return
ResponseData
.
generateCreatedResponse
(
0
,
vodPlayHistoryService
.
testPlays
());
}
}
src/main/java/com/subsidy/mapper/VodDictMapper.java
View file @
e37f68e
...
...
@@ -5,6 +5,7 @@ import com.subsidy.model.VodDictDO;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.subsidy.vo.vod.ClassVodCompleteInfoVO
;
import
com.subsidy.vo.vod.GetContendVodsVO
;
import
com.subsidy.vo.vod.VodPlayStateVO
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
...
...
@@ -39,4 +40,9 @@ public interface VodDictMapper extends BaseMapper<VodDictDO> {
* 修改某个视频的顺序
*/
void
updateVodOrderNo
(
Long
id
,
Integer
orderNo
);
/**
* 重复数据查找
*/
List
<
VodPlayStateVO
>
testPlays
(
Long
memberId
);
}
src/main/java/com/subsidy/service/VodPlayHistoryService.java
View file @
e37f68e
...
...
@@ -6,6 +6,9 @@ import com.subsidy.dto.vod.SignDatePlaysDTO;
import
com.subsidy.dto.vod.FixDataTwoDTO
;
import
com.subsidy.model.VodPlayHistoryDO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.subsidy.vo.vod.VodPlayStateVO
;
import
java.util.List
;
/**
* <p>
...
...
@@ -28,4 +31,6 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
void
remainSeconds
(
RemainSecondsDTO
remainSecondsDTO
);
void
playLengthFix
(
RemainSecondsDTO
remainSecondsDTO
);
List
<
Long
>
testPlays
();
}
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
e37f68e
...
...
@@ -12,6 +12,7 @@ import com.subsidy.model.*;
import
com.subsidy.service.VodPlayHistoryService
;
import
com.subsidy.util.ConstantUtils
;
import
com.subsidy.util.RedisUtil
;
import
com.subsidy.vo.vod.VodPlayStateVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -612,6 +613,27 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
}
public
List
<
Long
>
testPlays
(){
List
<
MemberDO
>
memberDOS
=
memberMapper
.
selectList
(
null
);
List
<
Long
>
result
=
new
ArrayList
<>();
for
(
MemberDO
memberDO
:
memberDOS
){
List
<
VodPlayStateVO
>
vodPlayStateVOS
=
vodDictMapper
.
testPlays
(
memberDO
.
getId
());
for
(
int
i
=
0
;
i
<
vodPlayStateVOS
.
size
()
;
i
++){
for
(
int
k
=
i
+
1
;
k
<
vodPlayStateVOS
.
size
()
;
k
++){
VodPlayStateVO
vodPlayStateVO
=
vodPlayStateVOS
.
get
(
k
);
VodPlayStateVO
vodPlayStateVO1
=
vodPlayStateVOS
.
get
(
i
);
if
(
vodPlayStateVO
.
getStartDate
().
after
(
vodPlayStateVO1
.
getStartDate
())
&&
vodPlayStateVO
.
getStartDate
().
before
(
vodPlayStateVO1
.
getEndDate
())){
System
.
out
.
println
(
"11111111111111111111111"
+
vodPlayStateVO
);
result
.
add
(
vodPlayStateVO
.
getId
());
}
}
}
}
return
result
;
}
//19为基数的话,3次签到6.5到8,4次签到4.8-6,
// 5次4-6,6次3.2-6,7次及以上2.5-6吧
...
...
src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java
0 → 100644
View file @
e37f68e
package
com
.
subsidy
.
vo
.
vod
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
VodPlayStateVO
{
private
Long
id
;
private
Long
memberId
;
private
Date
startDate
;
private
Date
endDate
;
private
Integer
playLength
;
}
src/main/resources/application.properties
View file @
e37f68e
# 环境配置
spring.profiles.active
=
prod
spring.profiles.active
=
dev
# 端口号
spring.server.port
=
2345
9
spring.server.port
=
2345
7
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount
=
600
...
...
src/main/resources/mapper/VodDictMapper.xml
View file @
e37f68e
...
...
@@ -91,4 +91,18 @@
update vod_dict t set t.order_no = #{orderNo} where t.id = #{id}
</update>
<select
id=
"testPlays"
parameterType=
"long"
resultType=
"com.subsidy.vo.vod.VodPlayStateVO"
>
SELECT
id,
member_id,
DATE_SUB( create_date, INTERVAL play_length SECOND ) AS start_date,
create_date AS end_date,
t.play_length
FROM
vod_play_history t
where t.member_id = #{memberId}
ORDER BY
t.member_id,
start_date
</select>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment