rambo před 1 týdnem
rodič
revize
0cf6bac8ee

+ 4 - 4
python/api.py

@@ -284,9 +284,8 @@ async def process_handle_detail(request: Request, params: HandlerDetail):
         handler_result_folder, handler_result = await _process_cutout(
             run_main, config_data, goods_art_no_arrays, move_folder_array
         )
-            
         # 处理场景图和模特图
-        return_data_check_before_detail = run_main.check_before_detail(config_data)
+        return_data_check_before_detail = run_main.check_before_detail(config_data,is_detail)
         
         # 检查处理结果
         success_handler = return_data_check_before_detail.get("data", {}).get("config_data", {}).get("success_handler", [])
@@ -525,7 +524,7 @@ async def _process_cutout(run_main, config_data, goods_art_no_arrays, move_folde
                     "current":len(have_handler_keys),
                     "total":len(goods_art_no_arrays),
                     "error":0,
-                    "goods_art_no":have_handler_keys
+                    "goods_art_no":list(have_handler_keys)
                     }
         await sendAsyncMessage(
             msg="正在处理",
@@ -734,7 +733,7 @@ async def _process_model_images(aigc_clazz, run_main, return_data_check_before_d
         msg_type="upper_footer_progress",
         progress=upper_footer_progress
     )
-    
+    print("上脚图=====>>>>",goods_dict,return_data_check_before_detail)
     for goods_art_no_info in goods_dict.keys():
         goods_art_dict_info = goods_dict.get(goods_art_no_info,None)
         new_goods_dict.setdefault(goods_art_no_info,goods_art_dict_info)
@@ -796,6 +795,7 @@ async def _process_model_images(aigc_clazz, run_main, return_data_check_before_d
                 )
                 
             except (concurrent.futures.TimeoutError, Exception) as e:
+                print("模特图处理异常信息",e)
                 os.remove(save_image_path)
                 # upper_footer_finish_progress-=1
                 upper_footer_error_progress += 1

+ 1 - 1
python/service/online_request/module_online_data.py

@@ -238,7 +238,7 @@ class AIGCDataRequest(object):
         """生成上脚图"""
         url = settings.DOMAIN + "/api/ai_image/main/upper_footer"
         resultData = self.s.post(url, data=data, headers=self.post_headers).json()
-
+        print("生成上脚图", resultData)
         code = resultData.get("code", 0)
         message = resultData.get("message", "")
         if code != 0:

+ 13 - 13
python/service/run_main.py

@@ -390,7 +390,7 @@ class RunMain:
         config_data["sign_text"] = "已结束抠图处理"
         self.run_end_sign.emit(config_data)
 
-    def check_before_detail(self, config_data):
+    def check_before_detail(self, config_data,is_detail):
 
         # =============
         # 整体数据校验,返回错误内容,以及
@@ -472,16 +472,18 @@ class RunMain:
         print("temp_class====>", temp_name)
         # 获取所有文件夹基础数据内容  检查不满足要求的文件不满足要求移动到错误文件夹
         # 在访问 temp_class[temp_name].need_view 前增加检查
-        if temp_name not in temp_class or temp_class[temp_name] is None:
-            raise UnicornException(f"模板 {temp_name} 未正确初始化或不存在")
-
-        # 确保 temp_class[temp_name] 是可调用的
-        if not callable(temp_class[temp_name]):
-            raise UnicornException(f"模板 {temp_name} 不是有效的可调用对象")
-        try:
-          need_view_list = temp_class[temp_name].need_view
-        except KeyError as ke:
-          raise UnicornException("未选择详情页模板,请检查")
+        need_view_list = []
+        if is_detail == 1:
+            if temp_name not in temp_class or temp_class[temp_name] is None:
+                raise UnicornException(f"模板 {temp_name} 未正确初始化或不存在")
+
+            # 确保 temp_class[temp_name] 是可调用的
+            if not callable(temp_class[temp_name]):
+                raise UnicornException(f"模板 {temp_name} 不是有效的可调用对象")
+            try:
+                need_view_list = temp_class[temp_name].need_view
+            except KeyError as ke:
+                raise UnicornException("未选择详情页模板,请检查")
         _all_dir_info_data = get_all_dir_info_and_pic_info(
             image_dir, folder_name_list, need_view_list
         )
@@ -697,8 +699,6 @@ class RunMain:
                                 _goods_no_dict[goods_no] = value  # 需要生成的数据
                             finally_goods_no_need_temps[goods_no].append(__temp_name)
 
-            pass
-
         print("-----------------2goods_no_dict---------------")
         print(json.dumps(_goods_no_dict, ensure_ascii=False))
         print("-----------------2goods_no_dict---------------")