Commit 95df3085922d985e68c5eb10550f55c1bc0aa7f4
1 parent
70fa45d7
feature(*): 新增查询续保成交的数据
- 升级sdk新增查询接口 - 新增查询续保成交的数据
Showing
11 changed files
with
171 additions
and
119 deletions
fw-valhalla-dao/src/main/resources/mapper/ClueTaskMapper.xml
... | ... | @@ -195,7 +195,8 @@ |
195 | 195 | t2.vin, |
196 | 196 | t1.follow_user user_id, |
197 | 197 | t1.follow_user_name user_name, |
198 | - t1.follow_shop shop_id | |
198 | + t1.follow_shop shop_id, | |
199 | + t1.state state | |
199 | 200 | from clue_task t1 |
200 | 201 | inner join follow_clue t2 on t1.clue_id = t2.id |
201 | 202 | <where> | ... | ... |
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/ShouldBeCompletedDTO.java
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/BeCompletedQuery.java
1 | 1 | package cn.fw.valhalla.domain.query; |
2 | 2 | |
3 | +import lombok.AllArgsConstructor; | |
3 | 4 | import lombok.Data; |
5 | +import lombok.NoArgsConstructor; | |
4 | 6 | |
5 | 7 | |
6 | 8 | /** |
... | ... | @@ -13,6 +15,8 @@ import lombok.Data; |
13 | 15 | * @date : 2022-10-20 14:53 |
14 | 16 | */ |
15 | 17 | @Data |
18 | +@AllArgsConstructor | |
19 | +@NoArgsConstructor | |
16 | 20 | public class BeCompletedQuery { |
17 | 21 | /** |
18 | 22 | * 跟进人员id | ... | ... |
fw-valhalla-sdk/pom.xml
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | <relativePath>../pom.xml</relativePath> |
11 | 11 | </parent> |
12 | 12 | <artifactId>fw-valhalla-sdk</artifactId> |
13 | - <version>1.2.4</version> | |
13 | + <version>1.2.5</version> | |
14 | 14 | <packaging>jar</packaging> |
15 | 15 | <name>fw-valhalla-sdk</name> |
16 | 16 | |
... | ... | @@ -46,6 +46,13 @@ |
46 | 46 | <plugins> |
47 | 47 | <plugin> |
48 | 48 | <groupId>org.apache.maven.plugins</groupId> |
49 | + <artifactId>maven-deploy-plugin</artifactId> | |
50 | + <configuration> | |
51 | + <skip>false</skip> | |
52 | + </configuration> | |
53 | + </plugin> | |
54 | + <plugin> | |
55 | + <groupId>org.apache.maven.plugins</groupId> | |
49 | 56 | <artifactId>maven-source-plugin</artifactId> |
50 | 57 | <version>${maven-source-plugin.version}</version> |
51 | 58 | <executions> | ... | ... |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/FollowApiService.java
... | ... | @@ -52,4 +52,13 @@ public interface FollowApiService { |
52 | 52 | */ |
53 | 53 | @GetMapping("/should/ins/completed") |
54 | 54 | Message<List<ShouldBeCompletedResult>> queryInsShouldBeCompleted(@Validated @SpringQueryMap ShouldBeCompletedQuery query); |
55 | + | |
56 | + /** | |
57 | + * 查询续保跟进成交数据 | |
58 | + * | |
59 | + * @param query 查询参数 | |
60 | + * @return 人员 | |
61 | + */ | |
62 | + @GetMapping("/ins/completed_arr") | |
63 | + Message<List<ShouldBeCompletedResult>> queryInsCompletedGuys(@Validated @SpringQueryMap ShouldBeCompletedQuery query); | |
55 | 64 | } |
56 | 65 | \ No newline at end of file | ... | ... |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/ShouldBeCompletedQuery.java
... | ... | @@ -42,7 +42,7 @@ public class ShouldBeCompletedQuery { |
42 | 42 | return String.valueOf(second); |
43 | 43 | } |
44 | 44 | String timeStr = String.valueOf(startTime); |
45 | - return timeStr.length() >= 9 ? timeStr.substring(0, 9) : timeStr; | |
45 | + return timeStr.length() >= 10 ? timeStr.substring(0, 10) : timeStr; | |
46 | 46 | } |
47 | 47 | |
48 | 48 | public String getEndTime() { |
... | ... | @@ -51,6 +51,6 @@ public class ShouldBeCompletedQuery { |
51 | 51 | return String.valueOf(second); |
52 | 52 | } |
53 | 53 | String timeStr = String.valueOf(endTime); |
54 | - return timeStr.length() >= 9 ? timeStr.substring(0, 9) : timeStr; | |
54 | + return timeStr.length() >= 10 ? timeStr.substring(0, 10) : timeStr; | |
55 | 55 | } |
56 | 56 | } | ... | ... |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/ShouldBeCompletedResult.java
1 | 1 | package cn.fw.valhalla.sdk.result; |
2 | 2 | |
3 | +import lombok.AllArgsConstructor; | |
3 | 4 | import lombok.Data; |
5 | +import lombok.NoArgsConstructor; | |
4 | 6 | |
5 | 7 | /** |
6 | 8 | * 应成交数据 |
... | ... | @@ -12,6 +14,8 @@ import lombok.Data; |
12 | 14 | * @date : 2022-10-20 11:35 |
13 | 15 | */ |
14 | 16 | @Data |
17 | +@AllArgsConstructor | |
18 | +@NoArgsConstructor | |
15 | 19 | public class ShouldBeCompletedResult { |
16 | 20 | /** |
17 | 21 | * 车架号 |
... | ... | @@ -29,4 +33,8 @@ public class ShouldBeCompletedResult { |
29 | 33 | * 门店id |
30 | 34 | */ |
31 | 35 | private Long shopId; |
36 | + /** | |
37 | + * 状态 1:进行中 2:已成交 3:战败 | |
38 | + */ | |
39 | + private Integer state; | |
32 | 40 | } | ... | ... |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/FollowApiServiceImpl.java
... | ... | @@ -79,4 +79,11 @@ public class FollowApiServiceImpl implements FollowApiService { |
79 | 79 | public Message<List<ShouldBeCompletedResult>> queryInsShouldBeCompleted(@Validated @SpringQueryMap ShouldBeCompletedQuery query) { |
80 | 80 | return success(followApiBizService.queryShouldBeCompleted(query, FollowTypeEnum.IR)); |
81 | 81 | } |
82 | + | |
83 | + @Override | |
84 | + @GetMapping("/ins/completed_arr") | |
85 | + @ControllerMethod("查询续保跟进应成交台数") | |
86 | + public Message<List<ShouldBeCompletedResult>> queryInsCompletedGuys(@Validated @SpringQueryMap ShouldBeCompletedQuery query) { | |
87 | + return success(followApiBizService.queryCompletedGuys(query, FollowTypeEnum.IR)); | |
88 | + } | |
82 | 89 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowApiBizService.java deleted
1 | -package cn.fw.valhalla.service.bus.follow; | |
2 | - | |
3 | -import cn.fw.valhalla.domain.db.customer.AccidentPool; | |
4 | -import cn.fw.valhalla.domain.db.follow.ClueTask; | |
5 | -import cn.fw.valhalla.domain.db.follow.FollowClue; | |
6 | -import cn.fw.valhalla.domain.dto.ShouldBeCompletedDTO; | |
7 | -import cn.fw.valhalla.domain.enums.ClueStatusEnum; | |
8 | -import cn.fw.valhalla.domain.enums.FollowTypeEnum; | |
9 | -import cn.fw.valhalla.domain.query.BeCompletedQuery; | |
10 | -import cn.fw.valhalla.sdk.param.ShouldBeCompletedQuery; | |
11 | -import cn.fw.valhalla.sdk.result.ShouldBeCompletedResult; | |
12 | -import cn.fw.valhalla.service.data.AccidentPoolService; | |
13 | -import cn.fw.valhalla.service.data.ClueTaskService; | |
14 | -import cn.fw.valhalla.service.data.FollowClueService; | |
15 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
16 | -import org.springframework.beans.factory.annotation.Autowired; | |
17 | -import org.springframework.stereotype.Service; | |
18 | - | |
19 | -import java.util.ArrayList; | |
20 | -import java.util.List; | |
21 | -import java.util.Objects; | |
22 | - | |
23 | -/** | |
24 | - * 跟进api接口业务实现 | |
25 | - * | |
26 | - * @author : kurisu | |
27 | - * @version : 1.0 | |
28 | - * @className : FollowApiBizService | |
29 | - * @description : 跟进api接口业务实现 | |
30 | - * @date : 2022-10-20 14:35 | |
31 | - */ | |
32 | -@Service | |
33 | -public class FollowApiBizService { | |
34 | - private final ClueTaskService clueTaskService; | |
35 | - private final AccidentPoolService accidentPoolService; | |
36 | - private final FollowClueService followClueService; | |
37 | - | |
38 | - @Autowired | |
39 | - public FollowApiBizService(final ClueTaskService clueTaskService, | |
40 | - final AccidentPoolService accidentPoolService, | |
41 | - final FollowClueService followClueService) { | |
42 | - this.clueTaskService = clueTaskService; | |
43 | - this.accidentPoolService = accidentPoolService; | |
44 | - this.followClueService = followClueService; | |
45 | - } | |
46 | - | |
47 | - /** | |
48 | - * 查询应成交台数 | |
49 | - * | |
50 | - * @param query | |
51 | - * @param followTypeEnum | |
52 | - * @return | |
53 | - */ | |
54 | - public List<ShouldBeCompletedResult> queryShouldBeCompleted(ShouldBeCompletedQuery query, FollowTypeEnum followTypeEnum) { | |
55 | - BeCompletedQuery search = new BeCompletedQuery(); | |
56 | - search.setType(followTypeEnum.getValue()); | |
57 | - search.setShopId(query.getShopId()); | |
58 | - search.setUserId(query.getUserId()); | |
59 | - search.setStartTime(query.getStartTime()); | |
60 | - search.setEndTime(query.getEndTime()); | |
61 | - List<ShouldBeCompletedDTO> dtoList = clueTaskService.queryShouldBeCompleted(search); | |
62 | - List<ShouldBeCompletedResult> results = new ArrayList<>(); | |
63 | - for (ShouldBeCompletedDTO dto : dtoList) { | |
64 | - ShouldBeCompletedResult result = new ShouldBeCompletedResult(); | |
65 | - result.setVin(dto.getVin()); | |
66 | - result.setUserId(dto.getUserId()); | |
67 | - result.setUserName(dto.getUserName()); | |
68 | - result.setShopId(dto.getShopId()); | |
69 | - results.add(result); | |
70 | - } | |
71 | - return results; | |
72 | - } | |
73 | - | |
74 | - public ClueTask queryAccidentFollowerByPlate(String plateNo, Long groupId) { | |
75 | - AccidentPool lastOne = accidentPoolService.getOne(Wrappers.<AccidentPool>lambdaQuery() | |
76 | - .eq(AccidentPool::getPlateNo, plateNo) | |
77 | - .eq(AccidentPool::getGroupId, groupId) | |
78 | - .orderByDesc(AccidentPool::getCreateTime) | |
79 | - .last(" limit 1 ") | |
80 | - ); | |
81 | - | |
82 | - if (Objects.isNull(lastOne)) { | |
83 | - return null; | |
84 | - } | |
85 | - FollowClue lastOngoingClue = followClueService.getOne(Wrappers.<FollowClue>lambdaQuery() | |
86 | - .eq(FollowClue::getPlateNo, plateNo) | |
87 | - .eq(FollowClue::getClueType, FollowTypeEnum.AC) | |
88 | - .eq(FollowClue::getClueState, ClueStatusEnum.ONGOING) | |
89 | - .eq(FollowClue::getGroupId, groupId) | |
90 | - .last(" limit 1 ") | |
91 | - ); | |
92 | - | |
93 | - if (Objects.isNull(lastOngoingClue)) { | |
94 | - return null; | |
95 | - } | |
96 | - return clueTaskService.queryOngoingTaskByClueId(lastOngoingClue.getId()); | |
97 | - } | |
98 | -} |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowApiBizService.kt
0 → 100644
1 | +package cn.fw.valhalla.service.bus.follow; | |
2 | + | |
3 | +import cn.fw.valhalla.domain.db.customer.AccidentPool | |
4 | +import cn.fw.valhalla.domain.db.follow.ClueTask | |
5 | +import cn.fw.valhalla.domain.db.follow.FollowClue | |
6 | +import cn.fw.valhalla.domain.enums.ClueStatusEnum | |
7 | +import cn.fw.valhalla.domain.enums.FollowTypeEnum | |
8 | +import cn.fw.valhalla.domain.enums.TaskStateEnum | |
9 | +import cn.fw.valhalla.domain.query.BeCompletedQuery | |
10 | +import cn.fw.valhalla.sdk.param.ShouldBeCompletedQuery | |
11 | +import cn.fw.valhalla.sdk.result.ShouldBeCompletedResult | |
12 | +import cn.fw.valhalla.service.data.AccidentPoolService | |
13 | +import cn.fw.valhalla.service.data.ClueTaskService | |
14 | +import cn.fw.valhalla.service.data.FollowClueService | |
15 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers | |
16 | +import org.springframework.stereotype.Service | |
17 | +import java.util.* | |
18 | + | |
19 | +/** | |
20 | + * 跟进api接口业务实现 | |
21 | + * | |
22 | + * @author : kurisu | |
23 | + * @version : 1.0 | |
24 | + * @className : FollowApiBizService | |
25 | + * @description : 跟进api接口业务实现 | |
26 | + * @date : 2022-10-20 14:35 | |
27 | + */ | |
28 | +@Service | |
29 | +class FollowApiBizService( | |
30 | + val clueTaskService: ClueTaskService, | |
31 | + val accidentPoolService: AccidentPoolService, | |
32 | + val followClueService: FollowClueService | |
33 | +) { | |
34 | + | |
35 | + | |
36 | + /** | |
37 | + * 查询已成交续保数据 | |
38 | + * | |
39 | + * @param query | |
40 | + * @param followTypeEnum | |
41 | + * @return | |
42 | + */ | |
43 | + fun queryCompletedGuys( | |
44 | + query: ShouldBeCompletedQuery, | |
45 | + followTypeEnum: FollowTypeEnum | |
46 | + ): List<ShouldBeCompletedResult> { | |
47 | + val search = BeCompletedQuery() | |
48 | + search.type = followTypeEnum.value | |
49 | + search.shopId = query.shopId | |
50 | + search.userId = query.userId | |
51 | + search.startTime = query.startTime | |
52 | + search.endTime = query.endTime | |
53 | + val dtoList = clueTaskService.queryShouldBeCompleted(search) | |
54 | + return dtoList | |
55 | + .filter { TaskStateEnum.COMPLETE.value.equals(it.state) } | |
56 | + .map { | |
57 | + ShouldBeCompletedResult( | |
58 | + it.vin, | |
59 | + it.userId, | |
60 | + it.userName, | |
61 | + it.shopId, | |
62 | + it.state | |
63 | + ) | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * 查询应成交台数 | |
69 | + * | |
70 | + * @param query | |
71 | + * @param followTypeEnum | |
72 | + * @return | |
73 | + */ | |
74 | + fun queryShouldBeCompleted( | |
75 | + query: ShouldBeCompletedQuery, | |
76 | + followTypeEnum: FollowTypeEnum | |
77 | + ): List<ShouldBeCompletedResult> { | |
78 | + val search = BeCompletedQuery( | |
79 | + query.userId, | |
80 | + query.shopId, | |
81 | + query.startTime, | |
82 | + query.endTime, | |
83 | + followTypeEnum.value | |
84 | + ) | |
85 | + val dtoList = clueTaskService.queryShouldBeCompleted(search) | |
86 | + return dtoList.map { | |
87 | + ShouldBeCompletedResult( | |
88 | + it.vin, | |
89 | + it.userId, | |
90 | + it.userName, | |
91 | + it.shopId, | |
92 | + it.state | |
93 | + ) | |
94 | + } | |
95 | + } | |
96 | + | |
97 | + fun queryAccidentFollowerByPlate(plateNo: String, groupId: Long): ClueTask? { | |
98 | + val lastOne = accidentPoolService.getOne( | |
99 | + Wrappers.lambdaQuery<AccidentPool>() | |
100 | + .eq(AccidentPool::getPlateNo, plateNo) | |
101 | + .eq(AccidentPool::getGroupId, groupId) | |
102 | + .orderByDesc(AccidentPool::getCreateTime) | |
103 | + .last(" limit 1 ") | |
104 | + ) | |
105 | + | |
106 | + if (Objects.isNull(lastOne)) { | |
107 | + return null | |
108 | + } | |
109 | + val lastOngoingClue = followClueService.getOne( | |
110 | + Wrappers.lambdaQuery<FollowClue>() | |
111 | + .eq(FollowClue::getPlateNo, plateNo) | |
112 | + .eq(FollowClue::getClueType, FollowTypeEnum.AC) | |
113 | + .eq(FollowClue::getClueState, ClueStatusEnum.ONGOING) | |
114 | + .eq(FollowClue::getGroupId, groupId) | |
115 | + .last(" limit 1 ") | |
116 | + ); | |
117 | + | |
118 | + if (Objects.isNull(lastOngoingClue)) { | |
119 | + return null; | |
120 | + } | |
121 | + return clueTaskService.queryOngoingTaskByClueId(lastOngoingClue.id); | |
122 | + } | |
123 | +} | ... | ... |
pom.xml
... | ... | @@ -122,7 +122,7 @@ |
122 | 122 | <dependency> |
123 | 123 | <groupId>cn.fw</groupId> |
124 | 124 | <artifactId>fw-valhalla-sdk</artifactId> |
125 | - <version>1.2.4</version> | |
125 | + <version>1.2.5</version> | |
126 | 126 | </dependency> |
127 | 127 | <dependency> |
128 | 128 | <groupId>cn.fw</groupId> |
... | ... | @@ -300,14 +300,17 @@ |
300 | 300 | <dependency> |
301 | 301 | <groupId>org.jetbrains.kotlin</groupId> |
302 | 302 | <artifactId>kotlin-stdlib</artifactId> |
303 | + <version>${kotlin.version}</version> | |
303 | 304 | </dependency> |
304 | 305 | <dependency> |
305 | 306 | <groupId>org.jetbrains.kotlin</groupId> |
306 | 307 | <artifactId>kotlin-reflect</artifactId> |
308 | + <version>${kotlin.version}</version> | |
307 | 309 | </dependency> |
308 | 310 | <dependency> |
309 | 311 | <groupId>org.jetbrains.kotlin</groupId> |
310 | 312 | <artifactId>kotlin-stdlib-jdk8</artifactId> |
313 | + <version>${kotlin.version}</version> | |
311 | 314 | </dependency> |
312 | 315 | <dependency> |
313 | 316 | <groupId>com.fasterxml.jackson.module</groupId> |
... | ... | @@ -343,22 +346,6 @@ |
343 | 346 | </plugins> |
344 | 347 | </build> |
345 | 348 | |
346 | - <repositories> | |
347 | - <repository> | |
348 | - <id>aliyun</id> | |
349 | - <name>aliyun</name> | |
350 | - <url>https://maven.aliyun.com/nexus/content/groups/public/</url> | |
351 | - </repository> | |
352 | - </repositories> | |
353 | - | |
354 | - <pluginRepositories> | |
355 | - <pluginRepository> | |
356 | - <id>aliyun</id> | |
357 | - <name>aliyun</name> | |
358 | - <url>https://maven.aliyun.com/nexus/content/groups/public/</url> | |
359 | - </pluginRepository> | |
360 | - </pluginRepositories> | |
361 | - | |
362 | 349 | <distributionManagement> |
363 | 350 | <repository> |
364 | 351 | <id>feewee-maven-releases</id> | ... | ... |