diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 3bb1bbf..1dfdc5c 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -574,7 +574,7 @@ public class MemberServiceImpl extends ServiceImpl imple if (i == 0 && contentStatus) { //第一个视频默认打开 memberVodVO.setStatus(true); - } else if (memberVodVO.getPercent() == 100) { + } else if (memberVodVO.getPercent().equals("100")) { //这个视频看完了,已解锁 memberVodVO.setStatus(true); } else { @@ -599,7 +599,7 @@ public class MemberServiceImpl extends ServiceImpl imple int playCount = 0; for (MemberVodVO memberVodVO : memberVodVOS) { - if (100 == memberVodVO.getPercent()) { + if ("100".equals(memberVodVO.getPercent())) { playCount++; } } diff --git a/src/main/java/com/subsidy/util/TestMain.java b/src/main/java/com/subsidy/util/TestMain.java index 547881b..83c4e2b 100644 --- a/src/main/java/com/subsidy/util/TestMain.java +++ b/src/main/java/com/subsidy/util/TestMain.java @@ -5,11 +5,28 @@ import java.util.Random; public class TestMain { - public static void main(String[] args) { - String password = "123456"; - String saltCode = getRandomCharAndNumr(5); - String encryptString = encrypt("91ebn" + password); - System.out.println(encryptString); + public static void main(String[] args) throws Exception{ +// String password = "123456"; +// String saltCode = getRandomCharAndNumr(5); +// String encryptString = encrypt("91ebn" + password); +// System.out.println(encryptString); + + Thread thread1 = new Thread(() -> { + System.out.println("thread1"); + }); + Thread thread2 = new Thread(() -> { + System.out.println("thread2"); + }); + Thread thread3 = new Thread(() -> { + System.out.println("thread3"); + }); + thread1.start(); + thread1.join(); + thread2.start(); + thread2.join(); + thread3.start(); + thread3.join(); + } public static String encrypt(String string) { diff --git a/src/main/java/com/subsidy/vo/member/MemberVodVO.java b/src/main/java/com/subsidy/vo/member/MemberVodVO.java index fb9b71e..6111ef4 100644 --- a/src/main/java/com/subsidy/vo/member/MemberVodVO.java +++ b/src/main/java/com/subsidy/vo/member/MemberVodVO.java @@ -9,7 +9,7 @@ public class MemberVodVO { private Integer vodLength; - private Integer percent; + private String percent; /** * 解锁状态 diff --git a/src/main/resources/mapper/CourseContentMapper.xml b/src/main/resources/mapper/CourseContentMapper.xml index cce4a41..9a9ae4f 100644 --- a/src/main/resources/mapper/CourseContentMapper.xml +++ b/src/main/resources/mapper/CourseContentMapper.xml @@ -51,9 +51,8 @@ t3.vod_type, t3.vod_length, t3.play_record, - IF - ( t3.vod_length - t3.sumPlay > 0, t3.vod_length - t3.sumPlay, 0 ) AS leftLength, - if(round( t3.sumPlay * 100 / t3.vod_length, 0 ) < 100,round( t3.sumPlay * 100 / t3.vod_length, 0 ),100) AS percent + if(t3.vod_length - t3.sumPlay > 0, t3.vod_length - t3.sumPlay, 0 ) AS leftLength, + if(TRUNCATE( t3.sumPlay * 100 / t3.vod_length,2) < 100,TRUNCATE( t3.sumPlay * 100 / t3.vod_length, 2),100) AS percent FROM ( SELECT