From fddf7288e03506697838d1b0f071aa38af01cd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= <2270033969@qq.com> Date: Thu, 8 Aug 2024 21:32:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=85=A5=E7=9A=84=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=A8=A1=E6=9D=BF=E4=B8=8D=E5=87=86=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "multiple/\344\270\273\345\255\220Contoller.java" | 10 +++++++--- single/Controller.java | 7 +++++-- "single/\350\241\250\346\240\274.vue" | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git "a/multiple/\344\270\273\345\255\220Contoller.java" "b/multiple/\344\270\273\345\255\220Contoller.java" index 6ae531d..08c566c 100644 --- "a/multiple/\344\270\273\345\255\220Contoller.java" +++ "b/multiple/\344\270\273\345\255\220Contoller.java" @@ -11,8 +11,10 @@ import ${package}.common.log.annotation.SysLog; #if($opensource) import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; #else import ${package}.common.excel.annotation.ResponseExcel; +import ${package}.common.excel.annotation.RequestExcel; #end import ${package}.${moduleName}.entity.${ClassName}Entity; import ${package}.${moduleName}.entity.${ChildClassName}Entity; @@ -29,6 +31,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; +import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -192,7 +195,8 @@ public R removeChild(@RequestBody ${pk.attrType}[] ids) { @HasPermission("${moduleName}_${functionName}_export") #else @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_export')" ) - #end public List<${ClassName}Entity> export(${ClassName}Entity ${className},${pk.attrType}[] ids) { + #end + public List<${ClassName}Entity> export(${ClassName}Entity ${className},${pk.attrType}[] ids) { return ${className}Service.list(Wrappers.lambdaQuery(${className}).in(ArrayUtil.isNotEmpty(ids), ${ClassName}Entity::$str.getProperty($pk.attrName), ids)); } @@ -208,7 +212,7 @@ public R removeChild(@RequestBody ${pk.attrType}[] ids) { #else @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_export')" ) #end - public R import(@RequestExcel List ${className}List, BindingResult bindingResult) { - return R.ok( ${className}Service.saveBatch(${className}List)); + public R import(@RequestExcel List<${ClassName}Entity> ${className}List, BindingResult bindingResult) { + return R.ok(${className}Service.saveBatch(${className}List)); } } diff --git a/single/Controller.java b/single/Controller.java index d5e0567..aa8627d 100644 --- a/single/Controller.java +++ b/single/Controller.java @@ -12,8 +12,10 @@ import ${package}.common.log.annotation.SysLog; #if($opensource) import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; #else import ${package}.common.excel.annotation.ResponseExcel; +import ${package}.common.excel.annotation.RequestExcel; #end import ${package}.${moduleName}.entity.${ClassName}Entity; import ${package}.${moduleName}.service.${ClassName}Service; @@ -30,6 +32,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; +import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -194,7 +197,7 @@ public R removeById(@RequestBody ${pk.attrType}[] ids) { #else @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_export')" ) #end - public R import(@RequestExcel List ${className}List, BindingResult bindingResult) { - return R.ok( ${className}Service.saveBatch(${className}List)); + public R import(@RequestExcel List<${ClassName}Entity> ${className}List, BindingResult bindingResult) { + return R.ok(${className}Service.saveBatch(${className}List)); } } diff --git "a/single/\350\241\250\346\240\274.vue" "b/single/\350\241\250\346\240\274.vue" index 141bada..e8f7597 100644 --- "a/single/\350\241\250\346\240\274.vue" +++ "b/single/\350\241\250\346\240\274.vue" @@ -98,12 +98,12 @@ - +