|
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.xxl.job.core.enums.NoEn;
|
|
import com.xxl.job.core.enums.NoEn;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
@@ -39,6 +40,7 @@ import java.util.concurrent.Executors;
|
|
* @version V1.0
|
|
* @version V1.0
|
|
* @date 2021-05-21
|
|
* @date 2021-05-21
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class KuaishouProjectVideoGetServiceImpl extends ServiceImpl<KuaishouProjectVideoGetMapper, KuaishouProjectVideoGet> implements IKuaishouProjectVideoGetService {
|
|
public class KuaishouProjectVideoGetServiceImpl extends ServiceImpl<KuaishouProjectVideoGetMapper, KuaishouProjectVideoGet> implements IKuaishouProjectVideoGetService {
|
|
static ExecutorService kuaiShouExecutorService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService kuaiShouExecutorService = Executors.newFixedThreadPool(5);
|
|
@@ -60,10 +62,11 @@ public class KuaishouProjectVideoGetServiceImpl extends ServiceImpl<KuaishouProj
|
|
private IKuaiShouVideoGetService videoGetService;
|
|
private IKuaiShouVideoGetService videoGetService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void clearProjectVideo(Long projectId, Integer pageStart) {
|
|
|
|
|
|
+ public void clearProjectVideo(Long projectId, Integer pageNo) {
|
|
try {
|
|
try {
|
|
|
|
+ log.info("清洗快手项目素材数据,projectId:{},pageNo:{}", projectId,pageNo);
|
|
String updateTime = projectVideoGetMapper.queryLatestUpdateTime(projectId);
|
|
String updateTime = projectVideoGetMapper.queryLatestUpdateTime(projectId);
|
|
- PageHelper.startPage(pageStart, 1500);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo, 1500);
|
|
List<KuaishouProjectVideoGet> list = videoGetMapper.selectProjectVideo(projectId, updateTime);
|
|
List<KuaishouProjectVideoGet> list = videoGetMapper.selectProjectVideo(projectId, updateTime);
|
|
if (Check.isNull(list)) {
|
|
if (Check.isNull(list)) {
|
|
return;
|
|
return;
|
|
@@ -71,8 +74,9 @@ public class KuaishouProjectVideoGetServiceImpl extends ServiceImpl<KuaishouProj
|
|
projectVideoGetMapper.replaceBatch(list);
|
|
projectVideoGetMapper.replaceBatch(list);
|
|
Thread.sleep(500);
|
|
Thread.sleep(500);
|
|
clearProjectVideo(projectId, pageStart + 1);
|
|
clearProjectVideo(projectId, pageStart + 1);
|
|
|
|
+ clearProjectVideo(projectId, pageNo + 1);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("清洗项目数据异常",e);
|
|
|
|
|
|
+ log.error("清洗项目数据异常", e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|