Blame view

fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalTaskController.java 4.51 KB
936e630c   姜超   feature(*): 门店奖惩分配
1
2
3
4
5
6
7
8
9
10
11
12
  package cn.fw.morax.server.controller.erp;
  
  import cn.fw.approval.sdk.mq.ApprovalResult;
  import cn.fw.common.web.annotation.ControllerMethod;
  import cn.fw.data.base.domain.common.Message;
  import cn.fw.morax.common.utils.DateUtil;
  import cn.fw.morax.common.utils.PublicUtil;
  import cn.fw.morax.domain.dto.query.KpiGroupStaffQueryDTO;
  import cn.fw.morax.rpc.ehr.EhrRpcService;
  import cn.fw.morax.rpc.ehr.dto.PerformanceStaffDTO;
  import cn.fw.morax.server.consumer.FlowConsumer;
  import cn.fw.morax.server.task.*;
c043db4c   姜超   feature(*): 查看考评详情
13
  import cn.fw.morax.service.biz.eval.EvalCalculateService;
936e630c   姜超   feature(*): 门店奖惩分配
14
15
16
17
18
19
20
21
  import cn.fw.security.auth.client.annotation.Authorization;
  import cn.fw.security.auth.client.enums.AuthType;
  import lombok.RequiredArgsConstructor;
  import lombok.extern.slf4j.Slf4j;
  import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
  import org.springframework.validation.annotation.Validated;
  import org.springframework.web.bind.annotation.*;
  
c043db4c   姜超   feature(*): 查看考评详情
22
  import java.time.LocalDate;
936e630c   姜超   feature(*): 门店奖惩分配
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  import java.util.Date;
  import java.util.List;
  
  import static cn.fw.common.web.util.ResultBuilder.success;
  
  /**
   * @author : kurisu
   * @version : 1.0
   * @className : DebugController
   * @description : 绩效通用调试控制器
   * @date : 2022-04-11 10:45
   * @ignore
   */
  @Slf4j
  @RestController
  @Authorization(AuthType.NONE)
  @RequiredArgsConstructor
  @Validated
  @RequestMapping("/debug/task/eval")
  @ConditionalOnProperty(prefix = "task", name = "switch", havingValue = "on")
  public class EvalTaskController {
      private final EvalCalcTask evalCalcTask;
      private final EvalGroupTask evalGroupTask;
      private final EvalGroupUserTask evalGroupUserTask;
c043db4c   姜超   feature(*): 查看考评详情
47
      private final EvalCalculateService evalCalculateService;
936e630c   姜超   feature(*): 门店奖惩分配
48
49
50
  
      @GetMapping("/group-user")
      @ControllerMethod("考评组人员")
c043db4c   姜超   feature(*): 查看考评详情
51
      public Message<Void> processEvalUser(Date date) {
320f8884   姜超   feature(*): 修改个人考评
52
53
54
55
56
          if (PublicUtil.isEmpty(date)) {
              evalGroupUserTask.processEvalUser(LocalDate.now().minusDays(1L));
          } else {
              evalGroupUserTask.processEvalUser(DateUtil.date2LocalDate(date));
          }
936e630c   姜超   feature(*): 门店奖惩分配
57
58
59
          return success();
      }
  
936e630c   姜超   feature(*): 门店奖惩分配
60
      @GetMapping("/calc-cache")
da42a3d8   姜超   feature(*): 计算考评代码优化
61
      @ControllerMethod("缓存要计算的考评")
c043db4c   姜超   feature(*): 查看考评详情
62
63
64
65
66
67
      public Message<Void> cacheCalculableEvalGroup(Date date) {
          if (PublicUtil.isEmpty(date)) {
              evalCalculateService.cacheCalculableEvalGroupIds(LocalDate.now().minusDays(1L));
          } else {
              evalCalculateService.cacheCalculableEvalGroupIds(DateUtil.date2LocalDate(date));
          }
936e630c   姜超   feature(*): 门店奖惩分配
68
69
70
71
72
73
74
75
76
77
          return success();
      }
  
      @GetMapping("/calc")
      @ControllerMethod("计算考评")
      public Message<Void> calculateCacheEvalGroup() {
          evalCalcTask.calculateCacheEvalGroup();
          return success();
      }
  
a33a5f4c   姜超   feature(*): 考评数据抽取修改
78
79
80
81
82
83
84
85
86
87
88
89
90
      @GetMapping("/calc-cache-rank")
      @ControllerMethod("缓存要计算的考评排名")
      public Message<Void> cacheCalculableEvalGroupRank() {
          evalCalcTask.cacheCalculableEvalGroupRank();
          return success();
      }
  
      @GetMapping("/calc-rank")
      @ControllerMethod("计算考评排名")
      public Message<Void> calcEvalGroupRank() {
          evalCalcTask.calcEvalGroupRank();
          return success();
      }
da42a3d8   姜超   feature(*): 计算考评代码优化
91
92
93
94
  
      @GetMapping("/cache-reward")
      @ControllerMethod("缓存分配奖惩的考评池")
      public Message<Void> cacheDistEvalShopPoolIds() {
edc57409   姜超   feature(*): 考评奖惩分配
95
          evalCalcTask.cacheDistEvalShopPoolIds();
da42a3d8   姜超   feature(*): 计算考评代码优化
96
97
98
          return success();
      }
  
5a834c50   姜超   feature(*): 考评模板导出
99
100
101
102
103
104
105
      @GetMapping("/dist-reward")
      @ControllerMethod("分配奖惩")
      public Message<Void> distributionEvalReward() {
          evalCalcTask.distributionEvalReward();
          return success();
      }
  
936e630c   姜超   feature(*): 门店奖惩分配
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
      @GetMapping("/cache-report")
      @ControllerMethod("缓存需要上报的考评指标")
      public Message<Void> cacheReportEvalIndicator() {
          evalCalcTask.cacheReportEvalIndicator();
          return success();
      }
  
      @GetMapping("/persist-report")
      @ControllerMethod("持久化需要上报的考评指标")
      public Message<Void> kpiReport() {
          evalCalcTask.persistenceReportTodo();
          return success();
      }
  
      @GetMapping("/push-report")
      @ControllerMethod("每5分钟检查待办推送")
      public Message<Void> salaryReport() {
          evalCalcTask.pushReportTodo();
          return success();
      }
  
bc484bc4   姜超   feature(*): 定时任务发送修改
127
128
129
130
131
132
      @GetMapping("/send-notice")
      @ControllerMethod("发送业务上报mq通知")
      public Message<Void> sendNotice() {
          evalGroupTask.sendNotice();
          return success();
      }
936e630c   姜超   feature(*): 门店奖惩分配
133
  
c285665c   姜超   feature(*): 考评阶段指标上报
134
135
136
137
138
139
  //    @GetMapping("/eval-group")
  //    @ControllerMethod("处理考评组")
  //    public Message<Void> processCurMonthEffectEvals() {
  //        evalGroupTask.processCurMonthEffectEvals();
  //        return success();
  //    }
936e630c   姜超   feature(*): 门店奖惩分配
140
141
142
143
144
  
  
  
  
  }