|
@@ -73,14 +73,9 @@ const taskCallback = async (context) => {
|
|
|
const result = await manager.createRecord(today, cur_day_data.get(today));
|
|
|
console.log("创建新记录结果:", result);
|
|
|
}
|
|
|
- // const result = await manager.createRecord(today,cur_day_data[today]);
|
|
|
- // if(result.success){
|
|
|
-
|
|
|
- // }
|
|
|
cur_timeRange = timeRange
|
|
|
cur_timeRange.finish_count = 0
|
|
|
cur_page = 0
|
|
|
- // 示例:实际任务逻辑
|
|
|
await processTask();
|
|
|
};
|
|
|
|
|
@@ -95,6 +90,7 @@ async function startConsumer() {
|
|
|
|
|
|
async function processDetailTask(task_item) {
|
|
|
try{
|
|
|
+ console.log(" start processDetailTask")
|
|
|
let materialId_list = task_item.materialId_list
|
|
|
let materialId_data_list = task_item.materialId_data_list
|
|
|
let response = await pullDataService.get_detail(materialId_list)
|
|
@@ -132,8 +128,8 @@ async function processDetailTask(task_item) {
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
- console.log(" finish processDetailTask")
|
|
|
}
|
|
|
+ console.log(" finish processDetailTask")
|
|
|
}catch (error) {
|
|
|
console.error("processDetailTask:",error)
|
|
|
}finally{
|
|
@@ -168,7 +164,7 @@ async function process_material_list(response,page) {
|
|
|
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 = response.data.count
|
|
|
+ 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
|
|
@@ -202,7 +198,7 @@ async function process_material_list(response,page) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return {materialId_list:materialId_list,materialId_data_list:materialId_data_list,count:response.data.count}
|
|
|
+ return {materialId_list:materialId_list,materialId_data_list:materialId_data_list,count:response.data.list.length}
|
|
|
}
|
|
|
|
|
|
async function finish_material_list(response,page) {
|
|
@@ -266,7 +262,7 @@ async function processTask(){
|
|
|
// task_params = helper.getPaginationParams(detail_item.count,500)
|
|
|
// task_params.shift()
|
|
|
// detail_task.push(detail_item)
|
|
|
-
|
|
|
+ console.log("detail_item:",detail_item)
|
|
|
await processDetailTask(detail_item)
|
|
|
|
|
|
console.log("processTask over!")
|