Blame view

fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorController.java 4.82 KB
df2e90b8   姜超   feature(indicator...
1
2
  package cn.fw.morax.server.controller.erp;
  
c029d47e   姜超   feature(*): 考评导入修改
3
  import cn.fw.common.exception.BusinessException;
99c55e88   姜超   feature(*): 导入分页查询
4
  import cn.fw.common.page.AppPage;
df2e90b8   姜超   feature(indicator...
5
6
7
8
  import cn.fw.common.web.annotation.ControllerMethod;
  import cn.fw.common.web.auth.LoginAuthBean;
  import cn.fw.common.web.auth.annotation.CurrentUser;
  import cn.fw.data.base.domain.common.Message;
dc3c54cf   姜超   feature(*): 修改上传
9
  import cn.fw.morax.common.utils.PublicUtil;
99c55e88   姜超   feature(*): 导入分页查询
10
11
  import cn.fw.morax.domain.db.eval.EvalIndicatorImportDetail;
  import cn.fw.morax.domain.dto.query.EvalIndicatorImportQueryDTO;
ffdae9fa   姜超   feature(*): 上报数据修改
12
  import cn.fw.morax.domain.vo.eval.*;
c029d47e   姜超   feature(*): 考评导入修改
13
  import cn.fw.morax.domain.vo.salary.StaffPersonTaxVO;
74153fda   姜超   feature(*): 修改门店指标展示
14
  import cn.fw.morax.service.biz.eval.EvalIndicatorBizService;
02ed4b17   姜超   feature(*): 考评导入修改
15
  import cn.fw.morax.service.biz.eval.EvalIndicatorReportService;
df2e90b8   姜超   feature(indicator...
16
17
18
19
20
21
22
  import cn.fw.security.auth.client.annotation.Authorization;
  import cn.fw.security.auth.client.annotation.IgnoreAuth;
  import cn.fw.security.auth.client.enums.AuthType;
  import lombok.RequiredArgsConstructor;
  import lombok.extern.slf4j.Slf4j;
  import org.springframework.validation.annotation.Validated;
  import org.springframework.web.bind.annotation.*;
c029d47e   姜超   feature(*): 考评导入修改
23
  import org.springframework.web.multipart.MultipartFile;
df2e90b8   姜超   feature(indicator...
24
  
c029d47e   姜超   feature(*): 考评导入修改
25
26
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
99c55e88   姜超   feature(*): 导入分页查询
27
  import javax.validation.constraints.NotNull;
df2e90b8   姜超   feature(indicator...
28
  
0a90b3d7   姜超   feature(*): 考评组审批修改
29
30
  import java.util.List;
  
df2e90b8   姜超   feature(indicator...
31
32
33
  import static cn.fw.common.web.util.ResultBuilder.success;
  
  /**
df2e90b8   姜超   feature(indicator...
34
   * @author jiangchao
99c55e88   姜超   feature(*): 导入分页查询
35
   * @des: 导入考评指标控制器
c029d47e   姜超   feature(*): 考评导入修改
36
   * @date 2023/2/8 16:57
df2e90b8   姜超   feature(indicator...
37
38
39
40
41
42
43
   */
  @Slf4j
  @RequiredArgsConstructor
  @Authorization(AuthType.ERP)
  @Validated
  @IgnoreAuth
  @RestController
c029d47e   姜超   feature(*): 考评导入修改
44
  @RequestMapping("/erp/eval-indicator")
df2e90b8   姜超   feature(indicator...
45
46
  public class EvalIndicatorController {
  
99c55e88   姜超   feature(*): 导入分页查询
47
      private final EvalIndicatorReportService evalIndicatorReportService;
74153fda   姜超   feature(*): 修改门店指标展示
48
49
50
51
52
53
54
55
56
57
58
59
60
      private final EvalIndicatorBizService evalIndicatorBizService;
  
      /**
       * 考评指标
       *
       * @return
       */
      @IgnoreAuth
      @GetMapping("/indicators")
      @ControllerMethod("考评指标")
      public Message<List<EvalIndicatorVO>> getEvalIndicators() {
          return success(evalIndicatorBizService.getEvalIndicators());
      }
02ed4b17   姜超   feature(*): 考评导入修改
61
62
  
      /**
99c55e88   姜超   feature(*): 导入分页查询
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
       * 导入记录分页查询
       *
       * @return
       */
      @IgnoreAuth
      @GetMapping("/import-page")
      @ControllerMethod("导入记录分页查询")
      public Message<AppPage<EvalIndicatorImportRecordVO>> importPage(EvalIndicatorImportQueryDTO dto) {
          return success(evalIndicatorReportService.importPage(dto));
      }
  
      /**
       * 导入记录详情查询
       *
       * @return
       */
      @IgnoreAuth
      @GetMapping("/import-detail")
      @ControllerMethod("导入记录详情查询")
7060fbd3   姜超   feature(*): 修改代码格式
82
83
      public Message<List<EvalIndicatorImportDetailVO>> importDetail(@NotNull(message = "导入记录id不能为空") Long id, Boolean querySuccess) {
          return success(evalIndicatorReportService.importDetail(id, querySuccess));
99c55e88   姜超   feature(*): 导入分页查询
84
85
86
87
88
      }
  
  
      /**
       * 人员模板文件
02ed4b17   姜超   feature(*): 考评导入修改
89
90
91
92
93
       *
       * @return
       */
      @IgnoreAuth
      @GetMapping("/staff/template-file")
99c55e88   姜超   feature(*): 导入分页查询
94
      @ControllerMethod("人员模板文件")
02ed4b17   姜超   feature(*): 考评导入修改
95
96
97
98
99
      public Message<Void> staffTemplateFile(HttpServletRequest request, HttpServletResponse response) {
          evalIndicatorReportService.staffTemplateFile(request, response);
          return success();
      }
  
99c55e88   姜超   feature(*): 导入分页查询
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
      /**
       * 门店模板文件
       *
       * @return
       */
      @IgnoreAuth
      @GetMapping("/shop/template-file")
      @ControllerMethod("门店模板文件")
      public Message<Void> shopTemplateFile(HttpServletRequest request, HttpServletResponse response) {
          evalIndicatorReportService.shopTemplateFile(request, response);
          return success();
      }
  
      /**
       * 上传人员指标
       *
       * @return
       */
      @IgnoreAuth
dc3c54cf   姜超   feature(*): 修改上传
119
      @PostMapping("/analysis-staff")
99c55e88   姜超   feature(*): 导入分页查询
120
      @ControllerMethod("上传人员指标")
dc3c54cf   姜超   feature(*): 修改上传
121
      public Message<EvalIndicatorImportRecordVO> analysisStaffExcel(@RequestParam("file") MultipartFile file, @CurrentUser LoginAuthBean user) {
99c55e88   姜超   feature(*): 导入分页查询
122
123
124
          if (file.isEmpty()) {
              throw new BusinessException("请上传文件");
          }
dc3c54cf   姜超   feature(*): 修改上传
125
          return success(evalIndicatorReportService.uploadStaffIndicator(file, user));
99c55e88   姜超   feature(*): 导入分页查询
126
      }
df2e90b8   姜超   feature(indicator...
127
  
ffdae9fa   姜超   feature(*): 上报数据修改
128
      /**
dc3c54cf   姜超   feature(*): 修改上传
129
       * 上传门店指标
5ef1face   姜超   feature(*): 上传人员指标
130
131
132
133
       *
       * @return
       */
      @IgnoreAuth
dc3c54cf   姜超   feature(*): 修改上传
134
135
      @PostMapping("/analysis-shop")
      @ControllerMethod("上传门店指标")
3a93dfe7   姜超   feature(*): 考评指标修...
136
      public Message<EvalIndicatorImportRecordVO> uploadShopIndicator(@RequestParam("file") MultipartFile file, @CurrentUser LoginAuthBean user) {
5ef1face   姜超   feature(*): 上传人员指标
137
138
139
          if (file.isEmpty()) {
              throw new BusinessException("请上传文件");
          }
3a93dfe7   姜超   feature(*): 考评指标修...
140
          return success(evalIndicatorReportService.uploadShopIndicator(file, user));
5ef1face   姜超   feature(*): 上传人员指标
141
142
143
      }
  
      /**
dc3c54cf   姜超   feature(*): 修改上传
144
       * 保存上传人员数据
ffdae9fa   姜超   feature(*): 上报数据修改
145
146
147
       *
       * @return
       */
dc3c54cf   姜超   feature(*): 修改上传
148
149
150
151
152
      @GetMapping("/save-import")
      @ControllerMethod("保存上传人员数据")
      public Message<Void> uploadStaffIndicator(String key) {
          if (PublicUtil.isEmpty(key)) {
              throw new BusinessException("参数错误");
ffdae9fa   姜超   feature(*): 上报数据修改
153
          }
dc3c54cf   姜超   feature(*): 修改上传
154
          evalIndicatorReportService.saveImportIndicator(key);
b5babc65   姜超   feature(*): 参数修改
155
          return success();
ffdae9fa   姜超   feature(*): 上报数据修改
156
157
      }
  
df2e90b8   姜超   feature(indicator...
158
  }