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..b5f9daa 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: "https://gate.feewee.cn/file/download?fid=74d1d724f9be48baa5921f3782037c3b" + eval-shop: "https://gate.feewee.cn/file/download?fid=e4eb136962164264a78753bd1d6061f3" \ 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..fda5c13 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: "https://testgate.feewee.cn/file/download?fid=2d2b7e2ea632493db10cf7f3c97342a5" + eval-shop: "https://testgate.feewee.cn/file/download?fid=05a391b7424d48b2bb8c8f12366ad22a" \ 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);