From d9e88886b9adeeea527903f2138ff2192235faad Mon Sep 17 00:00:00 2001 From: jiangchao Date: Mon, 13 Mar 2023 16:22:47 +0800 Subject: [PATCH] feature(*): 模板文件修改 --- fw-morax-common/src/main/java/cn/fw/morax/common/config/FileVal.java | 22 ++++++++++++++++++++++ fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java | 10 ++++------ fw-morax-server/src/main/resources/application-prd.yml | 6 +++++- fw-morax-server/src/main/resources/application-test.yml | 6 +++++- fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorReportService.java | 9 +++++++++ 5 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 fw-morax-common/src/main/java/cn/fw/morax/common/config/FileVal.java diff --git a/fw-morax-common/src/main/java/cn/fw/morax/common/config/FileVal.java b/fw-morax-common/src/main/java/cn/fw/morax/common/config/FileVal.java new file mode 100644 index 0000000..6f7d410 --- /dev/null +++ b/fw-morax-common/src/main/java/cn/fw/morax/common/config/FileVal.java @@ -0,0 +1,22 @@ +package cn.fw.morax.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@ConfigurationProperties(prefix = "file-url") +@Component +public class FileVal { + + /** + * 考评人员模板 + */ + private String evalStaff; + + /** + * 考评门店模板 + */ + private String evalShop; + +} diff --git a/fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java b/fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java index ccb6e23..1c58914 100644 --- a/fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java +++ b/fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java @@ -93,9 +93,8 @@ public class EvalIndicatorController { @IgnoreUserToken @GetMapping("/staff/template-file") @ControllerMethod("人员模板文件") - public Message staffTemplateFile(HttpServletRequest request, HttpServletResponse response) { - evalIndicatorReportService.staffTemplateFile(request, response); - return success(); + public Message staffTemplateFile() { + return success(evalIndicatorReportService.staffTemplateFileUrl()); } /** @@ -106,9 +105,8 @@ public class EvalIndicatorController { @IgnoreUserToken @GetMapping("/shop/template-file") @ControllerMethod("门店模板文件") - public Message shopTemplateFile(HttpServletRequest request, HttpServletResponse response) { - evalIndicatorReportService.shopTemplateFile(request, response); - return success(); + public Message shopTemplateFile() { + return success(evalIndicatorReportService.shopTemplateFileUrl()); } /** diff --git a/fw-morax-server/src/main/resources/application-prd.yml b/fw-morax-server/src/main/resources/application-prd.yml index 4673966..341f257 100644 --- a/fw-morax-server/src/main/resources/application-prd.yml +++ b/fw-morax-server/src/main/resources/application-prd.yml @@ -56,4 +56,8 @@ todo: kpi-group-change: 'GoaTI9YO8v' salary-group-change: 'IWGFvyS0Wl' eval-indicator-import: 'PZm5ENk058' - dist-eval-reward: '7gRDSfq8J7' \ No newline at end of file + dist-eval-reward: '7gRDSfq8J7' + +file-url: + eval-staff: "admin.feewee.cn/api/file" + eval-sshop: "admin.feewee.cn/api/file" \ No newline at end of file diff --git a/fw-morax-server/src/main/resources/application-test.yml b/fw-morax-server/src/main/resources/application-test.yml index 21994b2..0c28a85 100644 --- a/fw-morax-server/src/main/resources/application-test.yml +++ b/fw-morax-server/src/main/resources/application-test.yml @@ -67,4 +67,8 @@ todo: kpi-group-change: 'pWRIQeXZvI' salary-group-change: 'zLFSx8BA2I' eval-indicator-import: 'Ymxx2oDdoY' - dist-eval-reward: 'Z5zts26iwi' \ No newline at end of file + dist-eval-reward: 'Z5zts26iwi' + +file-url: + eval-staff: "admin.feewee.cn/api/file" + eval-sshop: "admin.feewee.cn/api/file" \ No newline at end of file diff --git a/fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorReportService.java b/fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorReportService.java index a91ef83..c25e2a7 100644 --- a/fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorReportService.java +++ b/fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorReportService.java @@ -4,6 +4,7 @@ import cn.fw.common.data.mybatis.pagination.PageData; import cn.fw.common.exception.BusinessException; import cn.fw.common.page.AppPage; import cn.fw.common.web.auth.LoginAuthBean; +import cn.fw.morax.common.config.FileVal; import cn.fw.morax.common.pojo.event.ImportEvalIndicatorEvent; import cn.fw.morax.common.utils.EventBusUtil; import cn.fw.morax.common.utils.ExcelDataUtil; @@ -67,6 +68,7 @@ public class EvalIndicatorReportService { private final StringRedisTemplate stringRedisTemplate; private final EvalGroupService evalGroupService; private final EvalService evalService; + private final FileVal fileVal; @Value("${spring.cache.custom.global-prefix}:eval-import:") @Getter @@ -81,6 +83,13 @@ public class EvalIndicatorReportService { CommonService.downloadExcel(response, staffTemplateData(), encodeFileName, StaffIndicatorValueVO.class); } + public String staffTemplateFileUrl() { + return fileVal.getEvalStaff(); + } + public String shopTemplateFileUrl() { + return fileVal.getEvalShop(); + } + public void shopTemplateFile(HttpServletRequest request, HttpServletResponse response) { String fileName = "门店导入标准模板.xlsx"; String encodeFileName = CommonService.getEncodeName(request, fileName); -- libgit2 0.22.2