|
@@ -234,12 +234,13 @@ async def handle_detail(request: Request, params: HandlerDetail):
|
|
|
images = pr.read_all(session, conditions={"goods_art_no": goods_art_no})
|
|
images = pr.read_all(session, conditions={"goods_art_no": goods_art_no})
|
|
|
if not images:
|
|
if not images:
|
|
|
raise UnicornException("没有可用货号数据")
|
|
raise UnicornException("没有可用货号数据")
|
|
|
- detail_counts = len(params.template_image_order.split(","))
|
|
|
|
|
- image_counts = len(images)
|
|
|
|
|
- # if image_counts < detail_counts and is_only_cutout != 1:
|
|
|
|
|
- # raise UnicornException(
|
|
|
|
|
- # f"货号:[{goods_art_no}],实际照片数量:{image_counts}张,小于详情图要求数量:{detail_counts}张"
|
|
|
|
|
- # )
|
|
|
|
|
|
|
+ if is_only_cutout != 1:
|
|
|
|
|
+ detail_counts = len(params.template_image_order.split(","))
|
|
|
|
|
+ image_counts = len(images)
|
|
|
|
|
+ if image_counts < detail_counts:
|
|
|
|
|
+ raise UnicornException(
|
|
|
|
|
+ f"货号:[{goods_art_no}],实际照片数量:{image_counts}张,小于详情图要求数量:{detail_counts}张"
|
|
|
|
|
+ )
|
|
|
image_dir = "{}/data/".format(os.getcwd()).replace("\\", "/")
|
|
image_dir = "{}/data/".format(os.getcwd()).replace("\\", "/")
|
|
|
check_path(image_dir)
|
|
check_path(image_dir)
|
|
|
for itemImg in images:
|
|
for itemImg in images:
|