Commit d9e88886b9adeeea527903f2138ff2192235faad
1 parent
85eb9bf3
feature(*): 模板文件修改
模板文件修改
Showing
5 changed files
with
45 additions
and
8 deletions
fw-morax-common/src/main/java/cn/fw/morax/common/config/FileVal.java
0 → 100644
1 | +package cn.fw.morax.common.config; | ||
2 | + | ||
3 | +import lombok.Data; | ||
4 | +import org.springframework.boot.context.properties.ConfigurationProperties; | ||
5 | +import org.springframework.stereotype.Component; | ||
6 | + | ||
7 | +@Data | ||
8 | +@ConfigurationProperties(prefix = "file-url") | ||
9 | +@Component | ||
10 | +public class FileVal { | ||
11 | + | ||
12 | + /** | ||
13 | + * 考评人员模板 | ||
14 | + */ | ||
15 | + private String evalStaff; | ||
16 | + | ||
17 | + /** | ||
18 | + * 考评门店模板 | ||
19 | + */ | ||
20 | + private String evalShop; | ||
21 | + | ||
22 | +} |
fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java
@@ -93,9 +93,8 @@ public class EvalIndicatorController { | @@ -93,9 +93,8 @@ public class EvalIndicatorController { | ||
93 | @IgnoreUserToken | 93 | @IgnoreUserToken |
94 | @GetMapping("/staff/template-file") | 94 | @GetMapping("/staff/template-file") |
95 | @ControllerMethod("人员模板文件") | 95 | @ControllerMethod("人员模板文件") |
96 | - public Message<Void> staffTemplateFile(HttpServletRequest request, HttpServletResponse response) { | ||
97 | - evalIndicatorReportService.staffTemplateFile(request, response); | ||
98 | - return success(); | 96 | + public Message<String> staffTemplateFile() { |
97 | + return success(evalIndicatorReportService.staffTemplateFileUrl()); | ||
99 | } | 98 | } |
100 | 99 | ||
101 | /** | 100 | /** |
@@ -106,9 +105,8 @@ public class EvalIndicatorController { | @@ -106,9 +105,8 @@ public class EvalIndicatorController { | ||
106 | @IgnoreUserToken | 105 | @IgnoreUserToken |
107 | @GetMapping("/shop/template-file") | 106 | @GetMapping("/shop/template-file") |
108 | @ControllerMethod("门店模板文件") | 107 | @ControllerMethod("门店模板文件") |
109 | - public Message<Void> shopTemplateFile(HttpServletRequest request, HttpServletResponse response) { | ||
110 | - evalIndicatorReportService.shopTemplateFile(request, response); | ||
111 | - return success(); | 108 | + public Message<String> shopTemplateFile() { |
109 | + return success(evalIndicatorReportService.shopTemplateFileUrl()); | ||
112 | } | 110 | } |
113 | 111 | ||
114 | /** | 112 | /** |
fw-morax-server/src/main/resources/application-prd.yml
@@ -56,4 +56,8 @@ todo: | @@ -56,4 +56,8 @@ todo: | ||
56 | kpi-group-change: 'GoaTI9YO8v' | 56 | kpi-group-change: 'GoaTI9YO8v' |
57 | salary-group-change: 'IWGFvyS0Wl' | 57 | salary-group-change: 'IWGFvyS0Wl' |
58 | eval-indicator-import: 'PZm5ENk058' | 58 | eval-indicator-import: 'PZm5ENk058' |
59 | - dist-eval-reward: '7gRDSfq8J7' | ||
60 | \ No newline at end of file | 59 | \ No newline at end of file |
60 | + dist-eval-reward: '7gRDSfq8J7' | ||
61 | + | ||
62 | +file-url: | ||
63 | + eval-staff: "admin.feewee.cn/api/file" | ||
64 | + eval-sshop: "admin.feewee.cn/api/file" | ||
61 | \ No newline at end of file | 65 | \ No newline at end of file |
fw-morax-server/src/main/resources/application-test.yml
@@ -67,4 +67,8 @@ todo: | @@ -67,4 +67,8 @@ todo: | ||
67 | kpi-group-change: 'pWRIQeXZvI' | 67 | kpi-group-change: 'pWRIQeXZvI' |
68 | salary-group-change: 'zLFSx8BA2I' | 68 | salary-group-change: 'zLFSx8BA2I' |
69 | eval-indicator-import: 'Ymxx2oDdoY' | 69 | eval-indicator-import: 'Ymxx2oDdoY' |
70 | - dist-eval-reward: 'Z5zts26iwi' | ||
71 | \ No newline at end of file | 70 | \ No newline at end of file |
71 | + dist-eval-reward: 'Z5zts26iwi' | ||
72 | + | ||
73 | +file-url: | ||
74 | + eval-staff: "admin.feewee.cn/api/file" | ||
75 | + eval-sshop: "admin.feewee.cn/api/file" | ||
72 | \ No newline at end of file | 76 | \ No newline at end of file |
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; | @@ -4,6 +4,7 @@ import cn.fw.common.data.mybatis.pagination.PageData; | ||
4 | import cn.fw.common.exception.BusinessException; | 4 | import cn.fw.common.exception.BusinessException; |
5 | import cn.fw.common.page.AppPage; | 5 | import cn.fw.common.page.AppPage; |
6 | import cn.fw.common.web.auth.LoginAuthBean; | 6 | import cn.fw.common.web.auth.LoginAuthBean; |
7 | +import cn.fw.morax.common.config.FileVal; | ||
7 | import cn.fw.morax.common.pojo.event.ImportEvalIndicatorEvent; | 8 | import cn.fw.morax.common.pojo.event.ImportEvalIndicatorEvent; |
8 | import cn.fw.morax.common.utils.EventBusUtil; | 9 | import cn.fw.morax.common.utils.EventBusUtil; |
9 | import cn.fw.morax.common.utils.ExcelDataUtil; | 10 | import cn.fw.morax.common.utils.ExcelDataUtil; |
@@ -67,6 +68,7 @@ public class EvalIndicatorReportService { | @@ -67,6 +68,7 @@ public class EvalIndicatorReportService { | ||
67 | private final StringRedisTemplate stringRedisTemplate; | 68 | private final StringRedisTemplate stringRedisTemplate; |
68 | private final EvalGroupService evalGroupService; | 69 | private final EvalGroupService evalGroupService; |
69 | private final EvalService evalService; | 70 | private final EvalService evalService; |
71 | + private final FileVal fileVal; | ||
70 | 72 | ||
71 | @Value("${spring.cache.custom.global-prefix}:eval-import:") | 73 | @Value("${spring.cache.custom.global-prefix}:eval-import:") |
72 | @Getter | 74 | @Getter |
@@ -81,6 +83,13 @@ public class EvalIndicatorReportService { | @@ -81,6 +83,13 @@ public class EvalIndicatorReportService { | ||
81 | CommonService.downloadExcel(response, staffTemplateData(), encodeFileName, StaffIndicatorValueVO.class); | 83 | CommonService.downloadExcel(response, staffTemplateData(), encodeFileName, StaffIndicatorValueVO.class); |
82 | } | 84 | } |
83 | 85 | ||
86 | + public String staffTemplateFileUrl() { | ||
87 | + return fileVal.getEvalStaff(); | ||
88 | + } | ||
89 | + public String shopTemplateFileUrl() { | ||
90 | + return fileVal.getEvalShop(); | ||
91 | + } | ||
92 | + | ||
84 | public void shopTemplateFile(HttpServletRequest request, HttpServletResponse response) { | 93 | public void shopTemplateFile(HttpServletRequest request, HttpServletResponse response) { |
85 | String fileName = "门店导入标准模板.xlsx"; | 94 | String fileName = "门店导入标准模板.xlsx"; |
86 | String encodeFileName = CommonService.getEncodeName(request, fileName); | 95 | String encodeFileName = CommonService.getEncodeName(request, fileName); |