|
@@ -39,6 +39,24 @@ CMD.isBlackBook = function(all_black_books,book_id){
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+CMD.getPlatformInfo = function(PlatformConfig,tg_platform_id){
|
|
|
|
+ for (let index = 0; index < PlatformConfig.length; index++) {
|
|
|
|
+ const element = PlatformConfig[index];
|
|
|
|
+ if(element.tg_platform_id==tg_platform_id){
|
|
|
|
+ return element
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+CMD.getSharedPlatform = function(PlatformShared,platform_shared_id){
|
|
|
|
+ for (let index = 0; index < PlatformShared.length; index++) {
|
|
|
|
+ const element = PlatformShared[index];
|
|
|
|
+ if(element.id==platform_shared_id){
|
|
|
|
+ return JSON.parse(element.info)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
async function processTask(){
|
|
async function processTask(){
|
|
try{
|
|
try{
|
|
let MainConfig = await redis_help.getKeyValue("MainConfig")
|
|
let MainConfig = await redis_help.getKeyValue("MainConfig")
|
|
@@ -49,7 +67,30 @@ async function processTask(){
|
|
if(black_books!=null){
|
|
if(black_books!=null){
|
|
black_books = JSON.parse(black_books)
|
|
black_books = JSON.parse(black_books)
|
|
}
|
|
}
|
|
- let result = await video_applet_product_controllers.getAppletProductDataByStatus({status:0,wait_status:0,book_platform:config.platform_qimao})
|
|
|
|
|
|
+
|
|
|
|
+ let PlatformShared = await redis_help.getKeyValue("PlatformShared")
|
|
|
|
+
|
|
|
|
+ PlatformShared = JSON.parse(PlatformShared)
|
|
|
|
+
|
|
|
|
+ let platform_qimao_info = CMD.getPlatformInfo(PlatformConfig,config.platform_qimao)
|
|
|
|
+
|
|
|
|
+ let all_platform_list = CMD.getSharedPlatform(PlatformShared,platform_qimao_info.platform_shared_id)
|
|
|
|
+
|
|
|
|
+ let result = null
|
|
|
|
+
|
|
|
|
+ for (let index = 0; index < all_platform_list.length; index++) {
|
|
|
|
+ const tg_platform_id = all_platform_list[index];
|
|
|
|
+ let temp_result = await video_applet_product_controllers.getAppletProductDataByStatus({status:0,wait_status:0,book_platform:tg_platform_id})
|
|
|
|
+ if(temp_result.success){
|
|
|
|
+ result = temp_result
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(result==null){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
if(result.success){
|
|
if(result.success){
|
|
if(CMD.isBlackBook(black_books,result.data.product_id)){
|
|
if(CMD.isBlackBook(black_books,result.data.product_id)){
|
|
await video_applet_product_controllers.updateData({id:result.data.id},{
|
|
await video_applet_product_controllers.updateData({id:result.data.id},{
|
|
@@ -64,6 +105,7 @@ async function processTask(){
|
|
let PlatformInfo = null
|
|
let PlatformInfo = null
|
|
|
|
|
|
PlatformInfo = CMD.getPlatformInfoById(PlatformConfig,main_info.tg_platform_id)
|
|
PlatformInfo = CMD.getPlatformInfoById(PlatformConfig,main_info.tg_platform_id)
|
|
|
|
+
|
|
if(PlatformInfo==null){
|
|
if(PlatformInfo==null){
|
|
await video_applet_product_controllers.updateData({id:result.data.id},{
|
|
await video_applet_product_controllers.updateData({id:result.data.id},{
|
|
status:2,
|
|
status:2,
|
|
@@ -91,16 +133,16 @@ async function processTask(){
|
|
throw "主体配置错误:"
|
|
throw "主体配置错误:"
|
|
}
|
|
}
|
|
|
|
|
|
- if(result.data.book_platform==config.platform_qimao){
|
|
|
|
- qm_create_link_task_list.push({
|
|
|
|
- n_data:result.data,
|
|
|
|
- main_info:main_info,
|
|
|
|
- PlatformInfo:PlatformInfo
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ qm_create_link_task_list.push({
|
|
|
|
+ n_data:result.data,
|
|
|
|
+ main_info:main_info,
|
|
|
|
+ PlatformInfo:PlatformInfo
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ console.log("qm_create_link_task_list:",qm_create_link_task_list)
|
|
|
|
+
|
|
if(qm_create_link_task_list.length>0){
|
|
if(qm_create_link_task_list.length>0){
|
|
let qm_create_link_task = qm_create_link_task_list.pop()
|
|
let qm_create_link_task = qm_create_link_task_list.pop()
|
|
require('./qm_create_link').runTask(qm_create_link_task.n_data
|
|
require('./qm_create_link').runTask(qm_create_link_task.n_data
|