|
@@ -138,71 +138,75 @@ async function processDetailTask(task_item) {
|
|
|
}
|
|
|
|
|
|
async function process_material_list(response,page) {
|
|
|
-
|
|
|
- let FilterConfig = await redis_help.getKeyValue("FilterConfig")
|
|
|
- FilterConfig = JSON.parse(FilterConfig)
|
|
|
-
|
|
|
- let materialId_list = []
|
|
|
- let materialId_data_list = []
|
|
|
-
|
|
|
- if(!response.success){
|
|
|
- throw {msg:response,timeRange:cur_timeRange,fun:"get_novel_material_list"}
|
|
|
- }
|
|
|
- if(response.data == undefined||response.data == null){
|
|
|
- throw {msg:response,timeRange:cur_timeRange,fun:"get_novel_material_list"}
|
|
|
- }
|
|
|
-
|
|
|
- if(response.data.list == undefined||response.data.list == null){
|
|
|
- throw "没有数据了"
|
|
|
- }
|
|
|
- if(response.data.list.length<=0){
|
|
|
- throw "没有数据了"
|
|
|
- }
|
|
|
- if(cur_timeRange!=null){
|
|
|
- const today = helper.getLocalDate();
|
|
|
- // console.log("response.data:",response.data,today)
|
|
|
- if(cur_day_data.get(today)[cur_timeRange.start]){
|
|
|
- console.log("response.data.count:",response.data.count)
|
|
|
- console.log("(cur_day_data[today][timeRange.start]:",cur_day_data.get(today)[cur_timeRange.start])
|
|
|
- cur_timeRange.count = cur_timeRange.count + response.data.list.length
|
|
|
- cur_timeRange.cur_page = page
|
|
|
- cur_day_data.get(today)[cur_timeRange.start].count = response.data.count
|
|
|
- cur_day_data.get(today)[cur_timeRange.start].cur_page = page
|
|
|
- }else{
|
|
|
- console.log("cur_day_data空")
|
|
|
+ try{
|
|
|
+ let FilterConfig = await redis_help.getKeyValue("FilterConfig")
|
|
|
+ FilterConfig = JSON.parse(FilterConfig)
|
|
|
+
|
|
|
+ let materialId_list = []
|
|
|
+ let materialId_data_list = []
|
|
|
+
|
|
|
+ if(!response.success){
|
|
|
+ throw {msg:response,timeRange:cur_timeRange,fun:"get_novel_material_list"}
|
|
|
}
|
|
|
- manager.updateRecord(today,cur_day_data.get(today));
|
|
|
- }
|
|
|
- // console.log("materialId_list:",response.data.list)
|
|
|
- for (let index = 0; index < response.data.list.length; index++) {
|
|
|
- const origin_element = response.data.list[index];
|
|
|
- const result = await origin_data_controllers.getOriginData({
|
|
|
- materialId:origin_element.materialId})
|
|
|
- console.log("result:",result)
|
|
|
- if(result.success){
|
|
|
- // await origin_data_controllers.updateOriginData({id:result.data.id},
|
|
|
- // {
|
|
|
- // kepp_num:origin_element.favoriteCount.count,
|
|
|
- // comment_num:origin_element.commentCount.count,
|
|
|
- // like_num:origin_element.likeCount.count,
|
|
|
- // shared_num:origin_element.shareCount.count
|
|
|
- // })
|
|
|
- }else{
|
|
|
- console.log("result:",origin_element,FilterConfig)
|
|
|
- if(CMD.isRight(FilterConfig,origin_element)){
|
|
|
- materialId_list.push(origin_element.materialId)
|
|
|
- materialId_data_list[origin_element.materialId] = {
|
|
|
- kepp_num:origin_element.favoriteCount.count,
|
|
|
- comment_num:origin_element.commentCount.count,
|
|
|
- like_num:origin_element.likeCount.count,
|
|
|
- shared_num:origin_element.shareCount.count
|
|
|
+ if(response.data == undefined||response.data == null){
|
|
|
+ throw {msg:response,timeRange:cur_timeRange,fun:"get_novel_material_list"}
|
|
|
+ }
|
|
|
+
|
|
|
+ if(response.data.list == undefined||response.data.list == null){
|
|
|
+ throw "没有数据了"
|
|
|
+ }
|
|
|
+ if(response.data.list.length<=0){
|
|
|
+ throw "没有数据了"
|
|
|
+ }
|
|
|
+ if(cur_timeRange!=null){
|
|
|
+ const today = helper.getLocalDate();
|
|
|
+ // console.log("response.data:",response.data,today)
|
|
|
+ if(cur_day_data.get(today)[cur_timeRange.start]){
|
|
|
+ console.log("response.data.count:",response.data.count)
|
|
|
+ console.log("(cur_day_data[today][timeRange.start]:",cur_day_data.get(today)[cur_timeRange.start])
|
|
|
+ cur_timeRange.count = cur_timeRange.count + response.data.list.length
|
|
|
+ cur_timeRange.cur_page = page
|
|
|
+ cur_day_data.get(today)[cur_timeRange.start].count = response.data.count
|
|
|
+ cur_day_data.get(today)[cur_timeRange.start].cur_page = page
|
|
|
+ }else{
|
|
|
+ console.log("cur_day_data空")
|
|
|
+ }
|
|
|
+ manager.updateRecord(today,cur_day_data.get(today));
|
|
|
+ }
|
|
|
+ // console.log("materialId_list:",response.data.list)
|
|
|
+ for (let index = 0; index < response.data.list.length; index++) {
|
|
|
+ const origin_element = response.data.list[index];
|
|
|
+ const result = await origin_data_controllers.getOriginData({
|
|
|
+ materialId:origin_element.materialId})
|
|
|
+ console.log("result:",result)
|
|
|
+ if(result.success){
|
|
|
+ // await origin_data_controllers.updateOriginData({id:result.data.id},
|
|
|
+ // {
|
|
|
+ // kepp_num:origin_element.favoriteCount.count,
|
|
|
+ // comment_num:origin_element.commentCount.count,
|
|
|
+ // like_num:origin_element.likeCount.count,
|
|
|
+ // shared_num:origin_element.shareCount.count
|
|
|
+ // })
|
|
|
+ }else{
|
|
|
+ if(CMD.isRight(FilterConfig,origin_element)){
|
|
|
+ materialId_list.push(origin_element.materialId)
|
|
|
+ materialId_data_list[origin_element.materialId] = {
|
|
|
+ kepp_num:origin_element.favoriteCount.count,
|
|
|
+ comment_num:origin_element.commentCount.count,
|
|
|
+ like_num:origin_element.likeCount.count,
|
|
|
+ shared_num:origin_element.shareCount.count
|
|
|
+ }
|
|
|
+ console.log("materialId:",origin_element.materialId)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ console.log("materialId_list:",materialId_list)
|
|
|
+ return {materialId_list:materialId_list,materialId_data_list:materialId_data_list,count:response.data.list.length}
|
|
|
+ }catch(e){
|
|
|
+ console.log("materialId_list:",e)
|
|
|
+ return null
|
|
|
}
|
|
|
-
|
|
|
- console.log("materialId_list:",materialId_list)
|
|
|
- return {materialId_list:materialId_list,materialId_data_list:materialId_data_list,count:response.data.list.length}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
async function finish_material_list(response,page) {
|