fix 修复 !pr292 相关问题 并优化写法

This commit is contained in:
疯狂的狮子li
2023-03-02 23:32:29 +08:00
parent 6e21c64728
commit 2f558094d1
10 changed files with 15 additions and 17 deletions

View File

@ -75,8 +75,7 @@ public class TestDemoController extends BaseController {
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Void> importData(@RequestPart("file") MultipartFile file) throws Exception {
ExcelResult<TestDemoImportVo> excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true);
List<TestDemoImportVo> volist = excelResult.getList();
List<TestDemo> list = MapstructUtils.convert(volist, TestDemo.class);
List<TestDemo> list = MapstructUtils.convert(excelResult.getList(), TestDemo.class);
testDemoService.saveBatch(list);
return R.ok(excelResult.getAnalysis());
}

View File

@ -20,7 +20,7 @@ import jakarta.validation.constraints.NotNull;
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TestDemo.class)
@AutoMapper(target = TestDemo.class, reverseConvertGenerate = false)
public class TestDemoBo extends BaseEntity {
/**

View File

@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TestTree.class)
@AutoMapper(target = TestTree.class, reverseConvertGenerate = false)
public class TestTreeBo extends BaseEntity {
/**