|
|
@@ -22,7 +22,7 @@ from .base_deal import BaseDealImage
|
|
|
from middleware import UnicornException
|
|
|
from settings import recordDataPoint
|
|
|
import asyncio
|
|
|
-
|
|
|
+from utils.common import message_queue
|
|
|
|
|
|
class RunMain:
|
|
|
# run_end_sign = Signal(dict)
|
|
|
@@ -186,22 +186,10 @@ class RunMain:
|
|
|
|
|
|
# 抠图校验后的回调函数处理
|
|
|
def check_for_cutout_image_first_call_back(self, return_data):
|
|
|
- # return_data = {
|
|
|
- # "code": 99,
|
|
|
- # "message": "",
|
|
|
- # "data": {
|
|
|
- # "all_goods_art_no_folder_data": [],
|
|
|
- # },
|
|
|
- # }
|
|
|
code = return_data["code"]
|
|
|
config_data = return_data["data"]["config_data"]
|
|
|
config_data["sign_text"] = ""
|
|
|
if code != 0:
|
|
|
- # self.windows.show_message(return_data["message"])
|
|
|
- # self.show_progress_detail(return_data["message"])
|
|
|
- # _dialog_dict = {"text": return_data["message"],
|
|
|
- # "windows": self,
|
|
|
- # }
|
|
|
raise UnicornException(return_data["message"])
|
|
|
|
|
|
do_next = False
|
|
|
@@ -233,27 +221,6 @@ class RunMain:
|
|
|
elif button_1 == "继续" and button_2 is None and button_3 is None:
|
|
|
do_next = True
|
|
|
else:
|
|
|
- # print("runmain 179----------------")
|
|
|
- # # print(self)
|
|
|
- # # print(self.windows)
|
|
|
- # _dialog_dict = {"text": text,
|
|
|
- # "button_1": button_1,
|
|
|
- # "button_2": button_2,
|
|
|
- # "button_3": button_3,
|
|
|
- # "windows": self,
|
|
|
- # }
|
|
|
- # self.show_dialog_sign.emit(_dialog_dict)
|
|
|
- # # self.exec_()
|
|
|
- # # 等待事件被设置
|
|
|
- # self.event.wait()
|
|
|
- # print("self.dialog_result", self.dialog_result)
|
|
|
- # #
|
|
|
- # # my_dialog = DialogShow(self.windows, text=text, button_1=button_1, button_2=button_2,
|
|
|
- # # button_3=button_3)
|
|
|
- # # ret = my_dialog.exec()
|
|
|
- # print("460 ===============my_dialog.flag_name===============")
|
|
|
- # print(my_dialog.flag_name)
|
|
|
-
|
|
|
if "移除" in self.dialog_result:
|
|
|
for error_folder_data in [
|
|
|
x for x in all_goods_art_no_folder_data if x["label"] == "错误"
|
|
|
@@ -270,28 +237,6 @@ class RunMain:
|
|
|
goods_art_no_folder_data["folder_name"]
|
|
|
for goods_art_no_folder_data in all_goods_art_no_folder_data
|
|
|
]
|
|
|
- # try:
|
|
|
- # loop = asyncio.get_event_loop()
|
|
|
- # loop.create_task(sendSocketMessage(
|
|
|
- # code=0,
|
|
|
- # msg="开始处理抠图",
|
|
|
- # data={
|
|
|
- # "status": "进行中",
|
|
|
- # "goods_art_nos": goods_arts,
|
|
|
- # },
|
|
|
- # msg_type="segment_progress",
|
|
|
- # ))
|
|
|
- # except:
|
|
|
- # print('An exception occurred')
|
|
|
- # asyncio.run(sendSocketMessage(
|
|
|
- # code=0,
|
|
|
- # msg="开始处理抠图",
|
|
|
- # data={
|
|
|
- # "status": "进行中",
|
|
|
- # "goods_art_nos": goods_arts,
|
|
|
- # },
|
|
|
- # msg_type="segment_progress",
|
|
|
- # ))
|
|
|
if do_next:
|
|
|
all_goods_art_no_folder_data = [
|
|
|
x for x in all_goods_art_no_folder_data if x["label"] == "待处理"
|
|
|
@@ -312,32 +257,6 @@ class RunMain:
|
|
|
return new_func
|
|
|
else:
|
|
|
print("已结束抠图处理")
|
|
|
- # try:
|
|
|
- # loop = asyncio.get_event_loop()
|
|
|
- # loop.create_task(
|
|
|
- # sendSocketMessage(
|
|
|
- # code=0,
|
|
|
- # msg="抠图结束",
|
|
|
- # data={
|
|
|
- # "status": "已完成",
|
|
|
- # "goods_art_nos": goods_arts,
|
|
|
- # },
|
|
|
- # msg_type="segment_progress",
|
|
|
- # )
|
|
|
- # )
|
|
|
- # except:
|
|
|
- # print('An exception occurred')
|
|
|
- # asyncio.run(
|
|
|
- # sendSocketMessage(
|
|
|
- # code=0,
|
|
|
- # msg="抠图结束",
|
|
|
- # data={
|
|
|
- # "status": "已完成",
|
|
|
- # "goods_art_nos": goods_arts,
|
|
|
- # },
|
|
|
- # msg_type="segment_progress",
|
|
|
- # )
|
|
|
- # )
|
|
|
return True
|
|
|
|
|
|
def do_run_cutout_image(
|
|
|
@@ -522,18 +441,9 @@ class RunMain:
|
|
|
_result = {"code": 99, "message": "无法解析到数据,请检查登录企业"}
|
|
|
print("is_use_excel", is_use_excel)
|
|
|
if not is_use_excel:
|
|
|
- if settings.PROJECT == "红蜻蜓":
|
|
|
- # goods_no_dict输出为文件夹下涉及到的所有款为key的字典,后续通过解析字典,进行提取对应文件夹
|
|
|
- _result = self.data_mode_generate_detail.get_basic_goods_art_data_by_hqt_and_hlm(
|
|
|
- folder_name_list
|
|
|
- )
|
|
|
-
|
|
|
- elif settings.PROJECT == "惠利玛":
|
|
|
- if settings.Company:
|
|
|
- if "惠利玛" in settings.Company:
|
|
|
- _result = self.data_mode_generate_detail.get_basic_goods_art_data_by_hqt_and_hlm(
|
|
|
+ _result = self.data_mode_generate_detail.get_basic_goods_art_data_by_hqt_and_hlm(
|
|
|
folder_name_list
|
|
|
- )
|
|
|
+ )
|
|
|
else:
|
|
|
keys = settings.keys
|
|
|
_result = (
|
|
|
@@ -543,7 +453,7 @@ class RunMain:
|
|
|
keys,
|
|
|
)
|
|
|
)
|
|
|
- print("打印=======>>>>>>>_result=============>", _result)
|
|
|
+ print("打印=======>>>>>>>_result=============>", _result)
|
|
|
if _result["code"] == 0:
|
|
|
remote_data = _result["data"]
|
|
|
else:
|
|
|
@@ -561,7 +471,17 @@ class RunMain:
|
|
|
print("temp_class====>", temp_class)
|
|
|
print("temp_class====>", temp_name)
|
|
|
# 获取所有文件夹基础数据内容 检查不满足要求的文件不满足要求移动到错误文件夹
|
|
|
- need_view_list = temp_class[temp_name].need_view
|
|
|
+ # 在访问 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("未选择详情页模板,请检查")
|
|
|
_all_dir_info_data = get_all_dir_info_and_pic_info(
|
|
|
image_dir, folder_name_list, need_view_list
|
|
|
)
|
|
|
@@ -604,14 +524,14 @@ class RunMain:
|
|
|
"folder_path": "{}/{}".format(image_dir, one_folder),
|
|
|
}
|
|
|
)
|
|
|
- return_data["message"] += "文件夹:{} 找不到对应数据\n".format(
|
|
|
+ return_data["message"] += "文件夹:{} 在系统资料中找不到对应数据\n".format(
|
|
|
one_folder
|
|
|
)
|
|
|
return_data["data"]["config_data"]["success_handler"].append(
|
|
|
{
|
|
|
"goods_art_no": one_folder,
|
|
|
"success": False,
|
|
|
- "info": f"文件夹:{one_folder} 找不到对应数据",
|
|
|
+ "info": f"文件夹:{one_folder} 在系统资料中找不到对应数据",
|
|
|
}
|
|
|
)
|
|
|
|
|
|
@@ -675,7 +595,7 @@ class RunMain:
|
|
|
|
|
|
# 如果没有有效数据则进行退出
|
|
|
if not goods_no_dict:
|
|
|
- return_data["message"] += "没有任何有效数据\n"
|
|
|
+ return_data["message"] += "在系统资料中没有查询到有效数据\n"
|
|
|
return return_data
|
|
|
|
|
|
# 校验无误的文件夹数据 goods_no_dict为最终有效数据
|
|
|
@@ -732,8 +652,11 @@ class RunMain:
|
|
|
if goods_no not in goods_no_need_temps:
|
|
|
continue
|
|
|
for __temp_name in goods_no_need_temps[goods_no]:
|
|
|
- _path = "{}/{}/{}/{}".format(
|
|
|
- image_dir, "软件-详情图生成", __temp_name, goods_no
|
|
|
+ # _path = "{}/{}/{}/{}".format(
|
|
|
+ # image_dir, "软件-详情图生成", __temp_name, goods_no
|
|
|
+ # )
|
|
|
+ _path = "{}/{}/切片图-{}".format(
|
|
|
+ image_dir, f"详情图-{goods_no}",__temp_name
|
|
|
)
|
|
|
if not os.path.exists(_path):
|
|
|
print("款号详情图不存在", _path)
|
|
|
@@ -790,12 +713,46 @@ class RunMain:
|
|
|
|
|
|
return_data["code"] = 0
|
|
|
return return_data
|
|
|
-
|
|
|
+ def sendAsyncMessage(self,msg="", goods_arts=[], status="",progress={}):
|
|
|
+ """异步发送消息"""
|
|
|
+ data = {
|
|
|
+ "code": 0,
|
|
|
+ "msg": msg,
|
|
|
+ "status": 2,
|
|
|
+ "data": {
|
|
|
+ "status": status,
|
|
|
+ "goods_art_nos": goods_arts,
|
|
|
+ },
|
|
|
+ "progress":{
|
|
|
+ "msg_type":"detail_progress",
|
|
|
+ "name":"详情页",
|
|
|
+ "goods_art_no":progress.get("goods_art_no"),
|
|
|
+ "status":progress.get("status"),
|
|
|
+ "current":progress.get("current",0),
|
|
|
+ "total":progress.get("total",0),
|
|
|
+ "error":progress.get("error",0),
|
|
|
+ "folder":progress.get("folder",None)
|
|
|
+ },
|
|
|
+ "msg_type": "detail_progress",
|
|
|
+ }
|
|
|
+ print("\033[1;32;40m 详情页消息 \033[0m",data)
|
|
|
+ message_queue.put_nowait(data)
|
|
|
def move_error_folders(self, one_path, target_folder, message=""):
|
|
|
if os.path.exists(one_path):
|
|
|
check_path(target_folder)
|
|
|
move_folders(path_list=[one_path], target_folder=target_folder)
|
|
|
-
|
|
|
+ '''
|
|
|
+ total_progress = len(all_goods_art_no_folder_data)
|
|
|
+ finish_progress = 0
|
|
|
+ error_progress = 0
|
|
|
+ progress = {"status":"正在处理",
|
|
|
+ "current":finish_progress,
|
|
|
+ "total":total_progress,
|
|
|
+ "error":error_progress}
|
|
|
+ sendAsyncMessage(
|
|
|
+ msg="开始处理抠图", goods_arts=goods_art_nos, status="开始处理",progress=progress
|
|
|
+ )
|
|
|
+ '''
|
|
|
def check_for_detail_first_call_back(self, data):
|
|
|
# 首次数据校验的信息返回
|
|
|
# self.show_message(text="22222222222222222222222")
|
|
|
@@ -922,7 +879,8 @@ class RunMain:
|
|
|
image_dir = config_data["image_dir"]
|
|
|
|
|
|
# 详情图生成结果文件夹
|
|
|
- out_put_dir = "{}\软件-详情图生成".format(image_dir)
|
|
|
+ # out_put_dir = "{}\软件-详情图生成".format(image_dir)
|
|
|
+ out_put_dir = "{}".format(image_dir)
|
|
|
if settings.IS_TEST:
|
|
|
print("==============_goods_no_dict 打印=================")
|
|
|
|
|
|
@@ -932,9 +890,34 @@ class RunMain:
|
|
|
|
|
|
all_detail_path_list = []
|
|
|
out_put_dir_resp = ""
|
|
|
+ detail_total_progress = len(finally_goods_no_need_temps.items())
|
|
|
+ detail_finish_progress = 0
|
|
|
+ detail_error_progress = 0
|
|
|
+ detail_progress = {"status":"正在处理", "current":detail_finish_progress, "total":detail_total_progress, "error":detail_error_progress}
|
|
|
+ self.sendAsyncMessage(
|
|
|
+ msg="准备处理详情页",
|
|
|
+ goods_arts=[],
|
|
|
+ status="准备处理详情页",
|
|
|
+ progress=detail_progress
|
|
|
+ )
|
|
|
for goods_no, temp_name_list in finally_goods_no_need_temps.items():
|
|
|
for _temp_name in temp_name_list:
|
|
|
try:
|
|
|
+ detail_finish_progress+=1
|
|
|
+ detail_progress = {
|
|
|
+ "status":"正在处理",
|
|
|
+ "goods_art_no":goods_no,
|
|
|
+ "current":detail_finish_progress,
|
|
|
+ "total":detail_total_progress,
|
|
|
+ "error":detail_error_progress,
|
|
|
+ "folder":""
|
|
|
+ }
|
|
|
+ self.sendAsyncMessage(
|
|
|
+ msg="正在处理详情页",
|
|
|
+ goods_arts=[],
|
|
|
+ status="正在处理详情页",
|
|
|
+ progress=detail_progress
|
|
|
+ )
|
|
|
# if _temp_name != "xiaosushuoxie-4":
|
|
|
# continue
|
|
|
assigned_page_list = []
|
|
|
@@ -953,12 +936,16 @@ class RunMain:
|
|
|
if _key in temp_info_data:
|
|
|
temp_info_data[_key] = _key_value
|
|
|
print("goods_no:{},_temp_name:{}".format(goods_no, _temp_name))
|
|
|
- out_put_dir_resp = "{}/详情模板{}/{}".format(
|
|
|
- out_put_dir, _temp_name, goods_no
|
|
|
- )
|
|
|
- all_detail_path_list.append(
|
|
|
- "{}/详情模板{}/{}".format(out_put_dir, _temp_name, goods_no)
|
|
|
+ # out_put_dir_resp = "{}/详情模板{}/{}".format(
|
|
|
+ # out_put_dir, _temp_name, goods_no
|
|
|
+ # )
|
|
|
+ out_put_dir_resp = "{}/详情图-{}".format(
|
|
|
+ out_put_dir, goods_no
|
|
|
)
|
|
|
+ # all_detail_path_list.append(
|
|
|
+ # "{}/详情模板{}/{}".format(out_put_dir, _temp_name, goods_no)
|
|
|
+ # )
|
|
|
+ all_detail_path_list.append(out_put_dir_resp)
|
|
|
# continue
|
|
|
self.detail_deal_one_data(
|
|
|
goods_no=goods_no,
|
|
|
@@ -973,6 +960,13 @@ class RunMain:
|
|
|
config_data["success_handler"].append(
|
|
|
{"goods_art_no": goods_no, "success": True, "info": "处理成功"}
|
|
|
)
|
|
|
+ detail_progress["folder"] = out_put_dir_resp
|
|
|
+ self.sendAsyncMessage(
|
|
|
+ msg="开始处理详情页",
|
|
|
+ goods_arts=[],
|
|
|
+ status="开始处理详情页",
|
|
|
+ progress=detail_progress
|
|
|
+ )
|
|
|
recordDataPoint(
|
|
|
token=self.token,
|
|
|
uuid=self.uuid,
|
|
|
@@ -980,6 +974,14 @@ class RunMain:
|
|
|
data={"goods_art_no": goods_no, "temp_name": _temp_name},
|
|
|
)
|
|
|
except BaseException as e:
|
|
|
+ detail_error_progress+=1
|
|
|
+ detail_progress = {"status":"处理失败","goods_art_no":goods_no, "current":detail_finish_progress, "total":detail_total_progress, "error":detail_error_progress,"folder":""}
|
|
|
+ self.sendAsyncMessage(
|
|
|
+ msg="处理失败",
|
|
|
+ goods_arts=[],
|
|
|
+ status="处理失败",
|
|
|
+ progress=detail_progress
|
|
|
+ )
|
|
|
self.show_progress_detail(
|
|
|
{
|
|
|
"goods_art_no": goods_no,
|
|
|
@@ -1025,132 +1027,23 @@ class RunMain:
|
|
|
print("out_put_dir_resp", out_put_dir_resp)
|
|
|
# 打开文件夹
|
|
|
# os.startfile(out_put_dir)
|
|
|
-
|
|
|
+ detail_finish_progress = self.total_num - self.fail_num
|
|
|
+ text_status = "处理完成" if detail_finish_progress > 0 else "处理失败"
|
|
|
+ detail_progress = {
|
|
|
+ "status":text_status,
|
|
|
+ "current":detail_finish_progress,
|
|
|
+ "total":self.total_num,
|
|
|
+ "error":self.fail_num,
|
|
|
+ "folder":out_put_dir_resp[0] if text_status=="处理完成" else "",
|
|
|
+ }
|
|
|
+ self.sendAsyncMessage(
|
|
|
+ msg=text_status,
|
|
|
+ goods_arts=[],
|
|
|
+ status=text_status,
|
|
|
+ progress=detail_progress
|
|
|
+ )
|
|
|
return config_data
|
|
|
|
|
|
- def detail_run_by_thread11111(
|
|
|
- self,
|
|
|
- config_data,
|
|
|
- _goods_no_dict,
|
|
|
- temp_name,
|
|
|
- temp_name_list,
|
|
|
- assigned_page_dict,
|
|
|
- excel_temp_goods_no_data,
|
|
|
- finally_goods_no_need_temps,
|
|
|
- ):
|
|
|
- """
|
|
|
- excel_temp_goods_no_data: {}, # 表格数据可能存在多模板,数据结构为一个款号下的多个模板的数据列表
|
|
|
- finally_goods_no_need_temps: {}, # 每个款号需要生成的模板数据
|
|
|
- """
|
|
|
-
|
|
|
- # 开始处理
|
|
|
- self.n = 0
|
|
|
- self.total_num = len(_goods_no_dict)
|
|
|
- self.fail_num = 0
|
|
|
- is_use_excel = config_data["is_use_excel"]
|
|
|
- image_dir = config_data["image_dir"]
|
|
|
-
|
|
|
- # 详情图生成结果文件夹
|
|
|
- out_put_dir = "{}\软件-详情图生成".format(image_dir)
|
|
|
- if settings.IS_TEST:
|
|
|
- print("==============_goods_no_dict 打印=================")
|
|
|
-
|
|
|
- print(json.dumps(_goods_no_dict))
|
|
|
-
|
|
|
- print("==============_goods_no_dict 打印-end=================")
|
|
|
-
|
|
|
- if settings.IS_TEST:
|
|
|
- max_workers = 1
|
|
|
- else:
|
|
|
- max_workers = 1
|
|
|
-
|
|
|
- all_detail_path_list = []
|
|
|
-
|
|
|
- with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
|
|
|
- futures = []
|
|
|
- for goods_no, temp_name_list in finally_goods_no_need_temps.items():
|
|
|
- for _temp_name in temp_name_list:
|
|
|
- # if _temp_name != "xiaosushuoxie-4":
|
|
|
- # continue
|
|
|
-
|
|
|
- assigned_page_list = []
|
|
|
- if _temp_name in assigned_page_dict:
|
|
|
- assigned_page_list = assigned_page_dict[_temp_name]
|
|
|
- # 如果为使用表格,则获取表格中的数据作为款号的基础数据
|
|
|
- temp_info_data = copy.copy(_goods_no_dict[goods_no])
|
|
|
- if is_use_excel:
|
|
|
- # 将表格中的数据进行替换
|
|
|
- if goods_no in excel_temp_goods_no_data:
|
|
|
- if _temp_name in excel_temp_goods_no_data[goods_no]:
|
|
|
- # 将表格中的特定的模板的行,替换到goods_no的data中,因为不同的模板有数据特殊性
|
|
|
- print("xxxxxx====>", excel_temp_goods_no_data[goods_no])
|
|
|
- for _key, _key_value in excel_temp_goods_no_data[
|
|
|
- goods_no
|
|
|
- ][_temp_name].items():
|
|
|
- if _key in temp_info_data:
|
|
|
- temp_info_data[_key] = _key_value
|
|
|
-
|
|
|
- print("temp_info_data11111111111111111111111")
|
|
|
- print("goods_no:{},_temp_name:{}".format(goods_no, _temp_name))
|
|
|
- all_detail_path_list.append(
|
|
|
- "{}/{}/".format(out_put_dir, _temp_name, goods_no)
|
|
|
- )
|
|
|
- # continue
|
|
|
- futures.append(
|
|
|
- executor.submit(
|
|
|
- self.detail_deal_one_data,
|
|
|
- goods_no=goods_no,
|
|
|
- value=temp_info_data,
|
|
|
- out_put_dir=out_put_dir,
|
|
|
- temp_name=_temp_name,
|
|
|
- assigned_page_list=assigned_page_list,
|
|
|
- )
|
|
|
- )
|
|
|
-
|
|
|
- # for goods_no, value in _goods_no_dict.items():
|
|
|
- # _temp_name = temp_name
|
|
|
- # # 使用自定义的表格数据
|
|
|
- # if self.isUseTemplate is False:
|
|
|
- # if "模板名称" in value:
|
|
|
- # if value["模板名称"] in temp_name_list:
|
|
|
- # _temp_name = value["模板名称"]
|
|
|
- # assigned_page_list = []
|
|
|
- # if _temp_name in assigned_page_dict:
|
|
|
- # assigned_page_list = assigned_page_dict[_temp_name]
|
|
|
- #
|
|
|
- # futures.append(executor.submit(
|
|
|
- # self.deal_one_data,
|
|
|
- # goods_no=goods_no,
|
|
|
- # value=value,
|
|
|
- # out_put_dir=out_put_dir,
|
|
|
- # temp_name=_temp_name,
|
|
|
- # assigned_page_list=assigned_page_list,
|
|
|
- # ))
|
|
|
-
|
|
|
- # 使用 wait 方法等待所有任务完成
|
|
|
- done, not_done = concurrent.futures.wait(futures)
|
|
|
-
|
|
|
- # 处理完成的任务
|
|
|
- for future in done:
|
|
|
- if settings.IS_TEST:
|
|
|
- result = future.result()
|
|
|
-
|
|
|
- # ==============完成处理==============
|
|
|
- self.set_state(state_value=2)
|
|
|
- if self.total_num:
|
|
|
- if self.fail_num:
|
|
|
- self.show_progress_detail(
|
|
|
- "处理完成,-----------处理失败数据:{}个款".format(self.fail_num)
|
|
|
- )
|
|
|
- else:
|
|
|
- self.show_progress_detail("处理完成")
|
|
|
- else:
|
|
|
- self.show_progress_detail("没有任何数据")
|
|
|
-
|
|
|
- config_data["sign_text"] = "已结束详情处理"
|
|
|
- config_data["all_detail_path_list"] = all_detail_path_list
|
|
|
- self.run_end_sign.emit(config_data)
|
|
|
-
|
|
|
def show_progress_detail(self, text):
|
|
|
# self.show_progress_detail_sign.emit(text)
|
|
|
# self.windows.show_progress_detail(text)
|
|
|
@@ -1178,6 +1071,11 @@ class RunMain:
|
|
|
print("模板:", temp_name)
|
|
|
print("value:", value)
|
|
|
print("temp_class:", temp_class)
|
|
|
+ if temp_name not in temp_class or temp_class[temp_name] is None:
|
|
|
+ raise UnicornException(f"详情页模板 {temp_name} 未正确加载")
|
|
|
+
|
|
|
+ if not callable(temp_class[temp_name]):
|
|
|
+ raise UnicornException(f"详情页模板 {temp_name} 不是有效的可调用对象")
|
|
|
if settings.IS_TEST:
|
|
|
temp_class[temp_name](
|
|
|
goods_no,
|