|
|
@@ -1,8 +1,13 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
# @Author : YY
|
|
|
|
|
|
+from typing import List
|
|
|
+from typing_extensions import Annotated
|
|
|
+from pydantic import BeforeValidator
|
|
|
+
|
|
|
from ruoyi_common.constant import UserConstants
|
|
|
from ruoyi_common.base.model import AjaxResponse, TableResponse
|
|
|
+from ruoyi_common.base.transformer import ids_to_str_list
|
|
|
# from ruoyi_common.domain.entity import SysProductConf
|
|
|
from ruoyi_common.domain.entity import SysProductConf
|
|
|
from ruoyi_common.domain.enum import BusinessType
|
|
|
@@ -79,12 +84,14 @@ def system_productinfo_conf_update(dto:SysProductConf):
|
|
|
return AjaxResponse.from_success() if flag else AjaxResponse.from_error()
|
|
|
|
|
|
|
|
|
-@reg.api.route("/system/moduleConf/productConf/<string:id>", methods=["DELETE"])
|
|
|
+@reg.api.route("/system/moduleConf/productConf/<ids>", methods=["DELETE"])
|
|
|
@PathValidator()
|
|
|
@PreAuthorize(HasPerm("moduleConf:productConf:remove"))
|
|
|
@Log(title="单品配置管理",business_type=BusinessType.DELETE)
|
|
|
@JsonSerializer()
|
|
|
-def system_productinfo_conf_delete(id:str):
|
|
|
+def system_productinfo_conf_delete(
|
|
|
+ ids: Annotated[List[str], BeforeValidator(ids_to_str_list)]
|
|
|
+):
|
|
|
'''
|
|
|
删除单品配置
|
|
|
'''
|
|
|
@@ -93,6 +100,6 @@ def system_productinfo_conf_delete(id:str):
|
|
|
# if SysModuleProductinfoConfService.check_productinfo_conf_exist_user(id):
|
|
|
# return AjaxResponse.from_error("该单品配置存在用户,不允许删除")
|
|
|
# SysModuleProductinfoConfService.check_productinfo_conf_data_scope(id)
|
|
|
- flag = SysModuleProductinfoConfService.delete_productinfo_conf_by_id(id)
|
|
|
- return AjaxResponse.from_success() if flag else AjaxResponse.from_error()
|
|
|
+ flag = SysModuleProductinfoConfService.delete_productinfo_conf_by_id(ids)
|
|
|
+ return AjaxResponse.from_success() if flag > 0 else AjaxResponse.from_error()
|
|
|
|