PoolController.java
4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package cn.fw.shirasawa.server.controller.app;
import cn.fw.common.page.AppPage;
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;
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 cn.fw.shirasawa.domain.query.CluePoolQueryVO;
import cn.fw.shirasawa.domain.query.FollowPoolQueryVO;
import cn.fw.shirasawa.domain.query.FollowRecordPoolQuery;
import cn.fw.shirasawa.domain.query.SecretReportHistoryQuery;
import cn.fw.shirasawa.domain.vo.SecretReportHistoryVO;
import cn.fw.shirasawa.domain.vo.follow.FollowDetailVO;
import cn.fw.shirasawa.domain.vo.follow.FollowRecordHistoryVO;
import cn.fw.shirasawa.domain.vo.pool.CluePoolVO;
import cn.fw.shirasawa.domain.vo.pool.FollowPoolListVO;
import cn.fw.shirasawa.domain.vo.pool.FollowRecordPoolVO;
import cn.fw.shirasawa.service.bus.follow.FollowBizService;
import cn.fw.shirasawa.service.bus.follow.PoolBizService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
import static cn.fw.common.web.util.ResultBuilder.success;
/**
* @author : kurisu
* @className : PoolController
* @description :
* @date: 2020-11-11 17:26
*/
@Slf4j
@RestController
@Authorization(AuthType.APP)
@RequiredArgsConstructor
@Validated
@RequestMapping("/app/pool")
public class PoolController {
private final PoolBizService poolBizService;
private final FollowBizService followBizService;
@GetMapping("/follow/own/list")
@ControllerMethod("查询自己的跟进池列表")
public Message<AppPage<FollowPoolListVO>> ownFollowList(@CurrentUser LoginAuthBean currentUser, @Valid final FollowPoolQueryVO queryVO) {
AppPage<FollowPoolListVO> page = poolBizService.followList(currentUser, queryVO);
return success(page);
}
@GetMapping("/follow/list")
@IgnoreAuth
@ControllerMethod("查询跟进池列表")
public Message<AppPage<FollowPoolListVO>> followList(@Valid final FollowPoolQueryVO queryVO) {
AppPage<FollowPoolListVO> page = poolBizService.followList(null, queryVO);
return success(page);
}
@GetMapping("/follow/task/referId")
@IgnoreAuth
@ControllerMethod("根据业务id查询跟进任务id")
public Message<Long> queryTaskByReferId(@NotBlank(message = "业务id不能为空") final String referId,
@NotNull(message = "跟进类型不能为空") final Integer type,
@CurrentUser LoginAuthBean currentUser) {
return success(followBizService.queryTaskByReferId(referId, currentUser.getGroupId(), type));
}
@GetMapping("/follow/record/history")
@IgnoreAuth
@ControllerMethod("查询跟进待办历史记录")
public Message<List<FollowRecordHistoryVO>> todoRecordHistory(@NotNull(message = "跟进池id不能为空") final Long taskId) {
return success(followBizService.todoHistoryTask(taskId));
}
@GetMapping("/follow/detail")
@IgnoreAuth
@ControllerMethod("根据跟进池id查询跟进池详情")
public Message<FollowDetailVO> detail(@NotNull(message = "跟进池id不能为空") final Long taskId) {
return success(followBizService.followPoolDetail(taskId));
}
@GetMapping("/clue/list")
@IgnoreAuth
@ControllerMethod("查询客户线索池列表")
public Message<AppPage<CluePoolVO>> clueList(@Valid final CluePoolQueryVO queryVO) {
AppPage<CluePoolVO> page = poolBizService.clueList(queryVO);
return success(page);
}
@GetMapping("/secret/report/list")
@IgnoreAuth
@ControllerMethod("查询智能通话记录池列表")
public Message<AppPage<SecretReportHistoryVO>> reportList(@Valid final SecretReportHistoryQuery queryVO) {
AppPage<SecretReportHistoryVO> page = poolBizService.secretReportList(queryVO);
return success(page);
}
@GetMapping("/follow/record/log/list")
@IgnoreAuth
@ControllerMethod("查询跟进记录池列表")
public Message<AppPage<FollowRecordPoolVO>> recordPoolList(@CurrentUser LoginAuthBean currentUser, @Valid final FollowRecordPoolQuery queryVO) {
AppPage<FollowRecordPoolVO> page = poolBizService.recordPoolList(currentUser, queryVO);
return success(page);
}
}