From 7213cba666a2a0d7fae938a8c7f59fa2f45d84cb Mon Sep 17 00:00:00 2001 From: zhang chengzhi <3144712872@qq.com> Date: Sun, 11 Aug 2024 09:27:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=A8=E9=80=81=E5=BE=AE?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../muyu/resource/domain/ResourceInfo.java | 23 ++++++++++++++++++- .../controller/ResourceController.java | 6 ++++- .../src/main/resources/bootstrap.yml | 4 +++- .../src/main/resources/logback/dev.xml | 2 +- .../src/main/resources/logback/prod.xml | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java b/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java index 8b4aea5..3b99f03 100644 --- a/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java +++ b/cloud-resource-common/src/main/java/com/muyu/resource/domain/ResourceInfo.java @@ -18,28 +18,49 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor public class ResourceInfo { - +@Excel(name = "序号") private String id; +@Excel(name = "荐购id") private String recommendId; +@Excel(name = "题名") private String title; +@Excel(name = "只用来查重,格式化题名") private String titleFormat; +@Excel(name = "题名译名") private String otherTitle; +@Excel(name = "分辑号 - 预留") private String seriesNumber; +@Excel(name = "分辑名") private String seriesTitle; +@Excel(name = "PISSN") private String pissn; +@Excel(name = "EISSN") private String eissn; +@Excel(name = "PISBN") private String pisbn; +@Excel(name = "EISBN") private String eisbn; +@Excel(name = "订购号") private String orderNumber; +@Excel(name = "学科") private String subject; +@Excel(name = "出版社") private String publisher; +@Excel(name = "国别") private String country; +@Excel(name = "出版年") private String pubYear; +@Excel(name = "创刊年") private String foundedYear; +@Excel(name = "语种") private String language; +@Excel(name = "出版频率") private String pubFeq; +@Excel(name = "内容简介") private String Intro; +@Excel(name = "分类号") private String classiNumber; +@Excel(name = "期刊URL地址") private String url; private String carrier; private String type; diff --git a/cloud-resource-server/src/main/java/com/muyu/resource/controller/ResourceController.java b/cloud-resource-server/src/main/java/com/muyu/resource/controller/ResourceController.java index 1c4680c..52752be 100644 --- a/cloud-resource-server/src/main/java/com/muyu/resource/controller/ResourceController.java +++ b/cloud-resource-server/src/main/java/com/muyu/resource/controller/ResourceController.java @@ -12,6 +12,7 @@ import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -39,9 +40,12 @@ public class ResourceController { @Log(title = "用户管理", businessType = BusinessType.IMPORT) @RequiresPermissions("Resource:ResourceInfo:import") @PostMapping("/importData") - public Result importData (MultipartFile file, boolean updateSupport) throws Exception { + public Result importData (@RequestParam("file") MultipartFile file) throws Exception { ExcelUtil util = new ExcelUtil(ResourceInfo.class); List resourceList = util.importExcel(file.getInputStream()); + + + // String operName = SecurityUtils.getUsername(); // String message = resourceService.importResource(resourceList, updateSupport, operName); return Result.success(resourceList); diff --git a/cloud-resource-server/src/main/resources/bootstrap.yml b/cloud-resource-server/src/main/resources/bootstrap.yml index 839e617..5fe13e3 100644 --- a/cloud-resource-server/src/main/resources/bootstrap.yml +++ b/cloud-resource-server/src/main/resources/bootstrap.yml @@ -51,4 +51,6 @@ spring: - application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} # rabbit 配置文件 - application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - +logging: + level: + com.muyu.system.mapper: DEBUG diff --git a/cloud-resource-server/src/main/resources/logback/dev.xml b/cloud-resource-server/src/main/resources/logback/dev.xml index a0e16b0..13a1ff3 100644 --- a/cloud-resource-server/src/main/resources/logback/dev.xml +++ b/cloud-resource-server/src/main/resources/logback/dev.xml @@ -1,7 +1,7 @@ - + diff --git a/cloud-resource-server/src/main/resources/logback/prod.xml b/cloud-resource-server/src/main/resources/logback/prod.xml index afd0098..3d34aca 100644 --- a/cloud-resource-server/src/main/resources/logback/prod.xml +++ b/cloud-resource-server/src/main/resources/logback/prod.xml @@ -1,7 +1,7 @@ - +