|
@@ -27,6 +27,7 @@ async function findSameFilterData(product_list,FilterConfig) {
|
|
|
|
|
|
}else{
|
|
|
let Ids = []
|
|
|
+ let notNeedMaterial = []
|
|
|
for (let j = 0; j < result.data.length; j++) {
|
|
|
let info = result.data[j]
|
|
|
info.words = product_item.words
|
|
@@ -36,10 +37,12 @@ async function findSameFilterData(product_list,FilterConfig) {
|
|
|
|
|
|
let isGenre = CMD.isGenre(FilterConfig,info.genre)
|
|
|
if(isGenre){
|
|
|
- CMD.video_product_material(info)
|
|
|
+ Ids.push(info.id)
|
|
|
+ }else{
|
|
|
+ notNeedMaterial.push(info.id)
|
|
|
}
|
|
|
- Ids.push(info.id)
|
|
|
}
|
|
|
+ await filter_data_controllers.updateFilterDataByIds({ids:notNeedMaterial},{status:1,material_sync_status:2})
|
|
|
await filter_data_controllers.updateFilterDataByIds({ids:Ids},{status:1})
|
|
|
await new Promise(resolve => setTimeout(resolve,100));
|
|
|
}
|
|
@@ -211,9 +214,7 @@ CMD.update_filter_data = async function(FilterConfig,data) {
|
|
|
// console.log("data.genre:",data.genre,data,isGenre)
|
|
|
if(isGenre){
|
|
|
try{
|
|
|
- CMD.video_product_material(data)
|
|
|
}catch(e){
|
|
|
- console.log("video_product_material error:",e)
|
|
|
}
|
|
|
await filter_data_controllers.updateFilterData({id:data.id},{status:1,book_id:data.book_id,book_name:data.book_name,genre:data.genre,words:data.words})
|
|
|
//创建一个小程序
|
|
@@ -282,45 +283,10 @@ CMD.update_filter_data = async function(FilterConfig,data) {
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
- await filter_data_controllers.updateFilterData({id:data.id},{status:2,book_id:data.book_id,book_name:data.book_name,genre:data.genre})
|
|
|
+ await filter_data_controllers.updateFilterData({id:data.id},{status:2,book_id:data.book_id,book_name:data.book_name,genre:data.genre,material_sync_status:2})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-CMD.video_product_material = async function(data){
|
|
|
- let url = config.isDebug?config.debug_supdate_config.host:config.release_supdate_config.host
|
|
|
- url = url+'/sapi/video_product_material/supdate';
|
|
|
- const formData = new FormData();
|
|
|
- formData.append('data',JSON.stringify({
|
|
|
- dy_id:data.video_id,
|
|
|
- dy_url:data.video_link,
|
|
|
- product_id:data.book_id,
|
|
|
- product_name:data.book_name,
|
|
|
- d_z_number:data.like_num,
|
|
|
- collect_number:data.kepp_num,
|
|
|
- comment_number: data.comment_num,
|
|
|
- forward_number: data.shared_num,
|
|
|
- book_platform: data.tg_platform_id,
|
|
|
- title: data.title,
|
|
|
- yun_fabu_time:data.publish_time
|
|
|
- }))
|
|
|
- axios.post(url, formData, {
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'multipart/form-data'
|
|
|
- }
|
|
|
- })
|
|
|
- .then(response => {
|
|
|
- if(response.data.code===10000){
|
|
|
- console.log("黑岩批处理插入任务表成功:", response.data);
|
|
|
- }else{
|
|
|
- console.log("插入任务表失败:", formData);
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- console.error("插入任务表失败:", error,formData);
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
CMD.insert_product = async function(data){
|
|
|
return await video_product_controllers.createProductData({
|
|
|
book_platform:data.tg_platform_id,
|