Commit 07b4049715788fd55c9b6329c87f8a1e80b515e3

Authored by 张志伟
2 parents 89c3bbf3 6b1e138d

Merge remote-tracking branch 'origin/dev' into test

fw-shirasawa-common/pom.xml
@@ -58,15 +58,4 @@ @@ -58,15 +58,4 @@
58 </dependency> 58 </dependency>
59 </dependencies> 59 </dependencies>
60 60
61 - <build>  
62 - <plugins>  
63 - <plugin>  
64 - <groupId>org.apache.maven.plugins</groupId>  
65 - <artifactId>maven-deploy-plugin</artifactId>  
66 - <configuration>  
67 - <skip>true</skip>  
68 - </configuration>  
69 - </plugin>  
70 - </plugins>  
71 - </build>  
72 </project> 61 </project>
73 \ No newline at end of file 62 \ No newline at end of file
fw-shirasawa-dao/pom.xml
@@ -34,16 +34,4 @@ @@ -34,16 +34,4 @@
34 <artifactId>fw-shirasawa-common</artifactId> 34 <artifactId>fw-shirasawa-common</artifactId>
35 </dependency> 35 </dependency>
36 </dependencies> 36 </dependencies>
37 -  
38 - <build>  
39 - <plugins>  
40 - <plugin>  
41 - <groupId>org.apache.maven.plugins</groupId>  
42 - <artifactId>maven-deploy-plugin</artifactId>  
43 - <configuration>  
44 - <skip>true</skip>  
45 - </configuration>  
46 - </plugin>  
47 - </plugins>  
48 - </build>  
49 </project> 37 </project>
50 \ No newline at end of file 38 \ No newline at end of file
fw-shirasawa-domain/pom.xml
@@ -35,16 +35,4 @@ @@ -35,16 +35,4 @@
35 <artifactId>fw-shirasawa-sdk</artifactId> 35 <artifactId>fw-shirasawa-sdk</artifactId>
36 </dependency> 36 </dependency>
37 </dependencies> 37 </dependencies>
38 -  
39 - <build>  
40 - <plugins>  
41 - <plugin>  
42 - <groupId>org.apache.maven.plugins</groupId>  
43 - <artifactId>maven-deploy-plugin</artifactId>  
44 - <configuration>  
45 - <skip>true</skip>  
46 - </configuration>  
47 - </plugin>  
48 - </plugins>  
49 - </build>  
50 </project> 38 </project>
51 \ No newline at end of file 39 \ No newline at end of file
fw-shirasawa-domain/src/main/java/cn/fw/shirasawa/domain/enums/FollowTypeEnum.java
@@ -25,6 +25,7 @@ public enum FollowTypeEnum implements IEnum&lt;Integer&gt; { @@ -25,6 +25,7 @@ public enum FollowTypeEnum implements IEnum&lt;Integer&gt; {
25 FA(8, "急救跟进"), 25 FA(8, "急救跟进"),
26 RV(9, "回访跟进"), 26 RV(9, "回访跟进"),
27 PL(10, "公共池跟进"), 27 PL(10, "公共池跟进"),
  28 + SF(11, "补贴跟进"),
28 /** 29 /**
29 * 其他 30 * 其他
30 * 目前只用于设置,并不参与具体跟进业务 31 * 目前只用于设置,并不参与具体跟进业务
fw-shirasawa-rpc/src/main/java/cn/fw/shirasawa/rpc/ehr/EhrRpcService.java
@@ -6,6 +6,7 @@ import cn.fw.ehr.sdk.api.result.StaffInfo; @@ -6,6 +6,7 @@ import cn.fw.ehr.sdk.api.result.StaffInfo;
6 import cn.fw.shirasawa.common.utils.StringUtils; 6 import cn.fw.shirasawa.common.utils.StringUtils;
7 import cn.fw.shirasawa.rpc.AbsBaseRpcService; 7 import cn.fw.shirasawa.rpc.AbsBaseRpcService;
8 import cn.fw.shirasawa.rpc.ehr.dto.StaffInfoDTO; 8 import cn.fw.shirasawa.rpc.ehr.dto.StaffInfoDTO;
  9 +import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO;
9 import com.alibaba.fastjson.JSONObject; 10 import com.alibaba.fastjson.JSONObject;
10 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
11 import org.springframework.beans.BeanUtils; 12 import org.springframework.beans.BeanUtils;
@@ -37,6 +38,22 @@ public class EhrRpcService extends AbsBaseRpcService { @@ -37,6 +38,22 @@ public class EhrRpcService extends AbsBaseRpcService {
37 } 38 }
38 39
39 @Nullable 40 @Nullable
  41 + public UserInfoDTO user(final Long userId) {
  42 + StaffInfoDTO staffInfoDTO = queryStaffInfo(userId);
  43 + if (Objects.isNull(staffInfoDTO)) {
  44 + return null;
  45 + }
  46 + return UserInfoDTO.builder()
  47 + .id(staffInfoDTO.getId())
  48 + .userName(staffInfoDTO.getName())
  49 + .headImg(staffInfoDTO.getAvatar())
  50 + .mobile(staffInfoDTO.getMobile())
  51 + .nickName(staffInfoDTO.getName())
  52 + .groupId(staffInfoDTO.getGroupId())
  53 + .build();
  54 + }
  55 +
  56 + @Nullable
40 public StaffInfoDTO queryStaffInfo(final Long userId) { 57 public StaffInfoDTO queryStaffInfo(final Long userId) {
41 if (userId == null) { 58 if (userId == null) {
42 return null; 59 return null;
fw-shirasawa-rpc/src/main/java/cn/fw/shirasawa/rpc/erp/UserService.java
1 package cn.fw.shirasawa.rpc.erp; 1 package cn.fw.shirasawa.rpc.erp;
2 2
3 import cn.fw.data.base.domain.common.Message; 3 import cn.fw.data.base.domain.common.Message;
4 -import cn.fw.erp.sdk.api.UserApi;  
5 import cn.fw.erp.sdk.api.UserRoleApi; 4 import cn.fw.erp.sdk.api.UserRoleApi;
6 -import cn.fw.erp.sdk.api.result.UserBaseInfo;  
7 import cn.fw.erp.sdk.api.result.UserRoleDataRange; 5 import cn.fw.erp.sdk.api.result.UserRoleDataRange;
8 import cn.fw.erp.sdk.api.result.UserRoleInfo; 6 import cn.fw.erp.sdk.api.result.UserRoleInfo;
9 -import cn.fw.shirasawa.common.utils.StringUtils;  
10 import cn.fw.shirasawa.rpc.AbsBaseRpcService; 7 import cn.fw.shirasawa.rpc.AbsBaseRpcService;
11 import cn.fw.shirasawa.rpc.erp.dto.PostUserDTO; 8 import cn.fw.shirasawa.rpc.erp.dto.PostUserDTO;
12 -import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO;  
13 import cn.fw.shirasawa.rpc.erp.dto.UserRoleDataRangeDTO; 9 import cn.fw.shirasawa.rpc.erp.dto.UserRoleDataRangeDTO;
14 import com.alibaba.fastjson.JSONObject; 10 import com.alibaba.fastjson.JSONObject;
15 import lombok.Getter; 11 import lombok.Getter;
@@ -26,10 +22,6 @@ import java.util.Collections; @@ -26,10 +22,6 @@ import java.util.Collections;
26 import java.util.List; 22 import java.util.List;
27 import java.util.Objects; 23 import java.util.Objects;
28 import java.util.concurrent.TimeUnit; 24 import java.util.concurrent.TimeUnit;
29 -import java.util.stream.Collectors;  
30 -  
31 -import static org.apache.commons.lang3.Validate.isTrue;  
32 -import static org.apache.commons.lang3.Validate.notNull;  
33 25
34 /** 26 /**
35 * 用户服务 27 * 用户服务
@@ -43,10 +35,6 @@ import static org.apache.commons.lang3.Validate.notNull; @@ -43,10 +35,6 @@ import static org.apache.commons.lang3.Validate.notNull;
43 @RequiredArgsConstructor 35 @RequiredArgsConstructor
44 public class UserService extends AbsBaseRpcService { 36 public class UserService extends AbsBaseRpcService {
45 /** 37 /**
46 - * 用户服务  
47 - */  
48 - private final UserApi userApi;  
49 - /**  
50 * 岗位用户服务 38 * 岗位用户服务
51 */ 39 */
52 private final UserRoleApi userRoleApi; 40 private final UserRoleApi userRoleApi;
@@ -56,83 +44,6 @@ public class UserService extends AbsBaseRpcService { @@ -56,83 +44,6 @@ public class UserService extends AbsBaseRpcService {
56 private String keyPrefix; 44 private String keyPrefix;
57 45
58 /** 46 /**
59 - * 根据用户ID获取用户信息  
60 - *  
61 - * @param userId 用户ID  
62 - * @return 用户信息  
63 - */  
64 - public UserInfoDTO user(final Long userId) {  
65 - if (Objects.isNull(userId)) {  
66 - return null;  
67 - }  
68 - String key = generateKey(userId);  
69 - String json = getFromCache(key);  
70 - if (StringUtils.isValid(json)) {  
71 - return JSONObject.parseObject(json, UserInfoDTO.class);  
72 - }  
73 - try {  
74 - final Message<UserBaseInfo> msg = userApi.queryUserBaseInfo(userId);  
75 - isTrue(msg.isSuccess(), String.format("调用ERP[根据用户ID[%s]获取用户信息]系统失败", msg.getResult()));  
76 - final UserBaseInfo userBaseInfo = msg.getData();  
77 - if (!msg.isSuccess() || Objects.isNull(msg.getData())) {  
78 - return null;  
79 - }  
80 - UserInfoDTO userInfoDTO = new UserInfoDTO();  
81 - userInfoDTO.setId(userBaseInfo.getUserId());  
82 - userInfoDTO.setUserName(userBaseInfo.getUserName());  
83 - userInfoDTO.setHeadImg(userBaseInfo.getHeadImg());  
84 - userInfoDTO.setMobile(msg.getData().getMobile());  
85 - setToCache(key, JSONObject.toJSONString(userInfoDTO), 60);  
86 - return userInfoDTO;  
87 - } catch (Exception e) {  
88 - log.info("调用ERP[根据用户ID[{}]获取用户信息]系统失败", userId, e);  
89 - }  
90 - return null;  
91 - }  
92 -  
93 - /**  
94 - * 批量获取用户名字  
95 - *  
96 - * @param userIds 用户ID集合  
97 - * @return 用户姓名集合  
98 - */  
99 - public List<String> userNames(final List<Long> userIds) {  
100 - if (CollectionUtils.isEmpty(userIds)) {  
101 - return Collections.emptyList();  
102 - }  
103 - Message<List<UserBaseInfo>> userMsg = userApi.queryUserBaseInfos(userIds);  
104 - isTrue(userMsg.isSuccess(), "批量获取用户信息失败");  
105 - notNull(userMsg.getData(), "批量获取用户信息为空");  
106 - return userMsg.getData().stream().map(UserBaseInfo::getUserName).collect(Collectors.toList());  
107 - }  
108 -  
109 - /**  
110 - * 批量获取用户  
111 - *  
112 - * @param userIds 用户ID集合  
113 - * @return 用户集合  
114 - */  
115 - public List<UserInfoDTO> users(final List<Long> userIds) {  
116 - if (CollectionUtils.isEmpty(userIds)) {  
117 - return Collections.emptyList();  
118 - }  
119 - Message<List<UserBaseInfo>> userMsg = userApi.queryUserBaseInfos(userIds);  
120 - isTrue(userMsg.isSuccess(), "批量获取用户信息失败");  
121 - notNull(userMsg.getData(), "批量获取用户信息为空");  
122 - List<UserInfoDTO> result = new ArrayList<>();  
123 - List<UserBaseInfo> userBaseInfoList = userMsg.getData();  
124 - for (UserBaseInfo userBaseInfo : userBaseInfoList) {  
125 - UserInfoDTO userInfoDTO = new UserInfoDTO();  
126 - userInfoDTO.setId(userBaseInfo.getUserId());  
127 - userInfoDTO.setUserName(userBaseInfo.getUserName());  
128 - userInfoDTO.setHeadImg(userBaseInfo.getHeadImg());  
129 - userInfoDTO.setMobile(userBaseInfo.getMobile());  
130 - result.add(userInfoDTO);  
131 - }  
132 - return result;  
133 - }  
134 -  
135 - /**  
136 * 获取某个流程角色的权限范围 47 * 获取某个流程角色的权限范围
137 * 48 *
138 * @param userId 49 * @param userId
fw-shirasawa-sdk/pom.xml
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 <relativePath>../pom.xml</relativePath> 10 <relativePath>../pom.xml</relativePath>
11 </parent> 11 </parent>
12 <artifactId>fw-shirasawa-sdk</artifactId> 12 <artifactId>fw-shirasawa-sdk</artifactId>
13 - <version>1.0.2</version> 13 + <version>1.0.3</version>
14 <packaging>jar</packaging> 14 <packaging>jar</packaging>
15 <name>fw-shirasawa-sdk</name> 15 <name>fw-shirasawa-sdk</name>
16 16
@@ -57,6 +57,13 @@ @@ -57,6 +57,13 @@
57 </execution> 57 </execution>
58 </executions> 58 </executions>
59 </plugin> 59 </plugin>
  60 + <plugin>
  61 + <groupId>org.apache.maven.plugins</groupId>
  62 + <artifactId>maven-deploy-plugin</artifactId>
  63 + <configuration>
  64 + <skip>false</skip>
  65 + </configuration>
  66 + </plugin>
60 </plugins> 67 </plugins>
61 </build> 68 </build>
62 </project> 69 </project>
63 \ No newline at end of file 70 \ No newline at end of file
fw-shirasawa-sdk/src/main/java/cn/fw/shirasawa/sdk/enums/DataTypeEnum.java
@@ -25,6 +25,7 @@ public enum DataTypeEnum implements IEnum&lt;Integer&gt; { @@ -25,6 +25,7 @@ public enum DataTypeEnum implements IEnum&lt;Integer&gt; {
25 FA(8, "急救"), 25 FA(8, "急救"),
26 RV(9, "回访"), 26 RV(9, "回访"),
27 PL(10, "公共池跟进"), 27 PL(10, "公共池跟进"),
  28 + SF(11, "补贴跟进"),
28 ; 29 ;
29 30
30 /** 31 /**
fw-shirasawa-sdk/src/main/java/cn/fw/shirasawa/sdk/param/FollowGenerateDTO.java
@@ -4,6 +4,7 @@ import cn.fw.shirasawa.sdk.enums.BusinessTypeEnum; @@ -4,6 +4,7 @@ import cn.fw.shirasawa.sdk.enums.BusinessTypeEnum;
4 import cn.fw.shirasawa.sdk.enums.DataTypeEnum; 4 import cn.fw.shirasawa.sdk.enums.DataTypeEnum;
5 import lombok.*; 5 import lombok.*;
6 6
  7 +import javax.validation.constraints.Future;
7 import javax.validation.constraints.NotBlank; 8 import javax.validation.constraints.NotBlank;
8 import javax.validation.constraints.NotEmpty; 9 import javax.validation.constraints.NotEmpty;
9 import javax.validation.constraints.NotNull; 10 import javax.validation.constraints.NotNull;
@@ -76,6 +77,7 @@ public class FollowGenerateDTO { @@ -76,6 +77,7 @@ public class FollowGenerateDTO {
76 /** 77 /**
77 * 截止时间 78 * 截止时间
78 */ 79 */
  80 + @Future(message = "截止时间必须是未来时间")
79 private Date deadline; 81 private Date deadline;
80 /** 82 /**
81 * 首次跟进待办截止时间 83 * 首次跟进待办截止时间
fw-shirasawa-server/pom.xml
@@ -149,13 +149,6 @@ @@ -149,13 +149,6 @@
149 <executable>true</executable> 149 <executable>true</executable>
150 </configuration> 150 </configuration>
151 </plugin> 151 </plugin>
152 - <plugin>  
153 - <groupId>org.apache.maven.plugins</groupId>  
154 - <artifactId>maven-deploy-plugin</artifactId>  
155 - <configuration>  
156 - <skip>true</skip>  
157 - </configuration>  
158 - </plugin>  
159 </plugins> 152 </plugins>
160 </build> 153 </build>
161 154
fw-shirasawa-server/src/main/resources/application-gray.yml
@@ -56,6 +56,7 @@ follow: @@ -56,6 +56,7 @@ follow:
56 PFCode: 'O6zZjZ17st' 56 PFCode: 'O6zZjZ17st'
57 FACode: '' 57 FACode: ''
58 RVCode: '' 58 RVCode: ''
  59 + SFCode: ''
59 FmTemplateCode: 'SMS_215116996' 60 FmTemplateCode: 'SMS_215116996'
60 RmTemplateCode: 'SMS_215072079' 61 RmTemplateCode: 'SMS_215072079'
61 IrTemplateCode: '' 62 IrTemplateCode: ''
fw-shirasawa-server/src/main/resources/application-prd.yml
@@ -55,6 +55,7 @@ follow: @@ -55,6 +55,7 @@ follow:
55 PFCode: 'O6zZjZ17st' 55 PFCode: 'O6zZjZ17st'
56 FACode: '' 56 FACode: ''
57 RVCode: '' 57 RVCode: ''
  58 + SFCode: ''
58 FmTemplateCode: 'SMS_215116996' 59 FmTemplateCode: 'SMS_215116996'
59 RmTemplateCode: 'SMS_215072079' 60 RmTemplateCode: 'SMS_215072079'
60 IrTemplateCode: '' 61 IrTemplateCode: ''
fw-shirasawa-server/src/main/resources/application-test.yml
@@ -66,6 +66,7 @@ follow: @@ -66,6 +66,7 @@ follow:
66 PFCode: 'O6zZjZ17st' 66 PFCode: 'O6zZjZ17st'
67 FACode: '' 67 FACode: ''
68 RVCode: '' 68 RVCode: ''
  69 + SFCode: ''
69 FmTemplateCode: '' 70 FmTemplateCode: ''
70 RmTemplateCode: '' 71 RmTemplateCode: ''
71 IrTemplateCode: '' 72 IrTemplateCode: ''
72 \ No newline at end of file 73 \ No newline at end of file
fw-shirasawa-server/src/main/resources/application.yml
@@ -145,6 +145,7 @@ follow: @@ -145,6 +145,7 @@ follow:
145 FACode: '' 145 FACode: ''
146 RVCode: '' 146 RVCode: ''
147 PLCode: '' 147 PLCode: ''
  148 + SFCode: ''
148 FmTemplateCode: '' 149 FmTemplateCode: ''
149 RmTemplateCode: '' 150 RmTemplateCode: ''
150 IrTemplateCode: '' 151 IrTemplateCode: ''
fw-shirasawa-service/pom.xml
@@ -117,15 +117,4 @@ @@ -117,15 +117,4 @@
117 <artifactId>fw-dfs-sdk</artifactId> 117 <artifactId>fw-dfs-sdk</artifactId>
118 </dependency> 118 </dependency>
119 </dependencies> 119 </dependencies>
120 - <build>  
121 - <plugins>  
122 - <plugin>  
123 - <groupId>org.apache.maven.plugins</groupId>  
124 - <artifactId>maven-deploy-plugin</artifactId>  
125 - <configuration>  
126 - <skip>true</skip>  
127 - </configuration>  
128 - </plugin>  
129 - </plugins>  
130 - </build>  
131 </project> 120 </project>
132 \ No newline at end of file 121 \ No newline at end of file
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/PoolBizService.java
@@ -15,12 +15,15 @@ import cn.fw.shirasawa.domain.vo.SecretReportHistoryVO; @@ -15,12 +15,15 @@ import cn.fw.shirasawa.domain.vo.SecretReportHistoryVO;
15 import cn.fw.shirasawa.domain.vo.pool.CluePoolVO; 15 import cn.fw.shirasawa.domain.vo.pool.CluePoolVO;
16 import cn.fw.shirasawa.domain.vo.pool.FollowPoolListVO; 16 import cn.fw.shirasawa.domain.vo.pool.FollowPoolListVO;
17 import cn.fw.shirasawa.domain.vo.pool.FollowRecordPoolVO; 17 import cn.fw.shirasawa.domain.vo.pool.FollowRecordPoolVO;
18 -import cn.fw.shirasawa.rpc.erp.UserService; 18 +import cn.fw.shirasawa.rpc.ehr.EhrRpcService;
19 import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO; 19 import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO;
20 import cn.fw.shirasawa.rpc.member.MemberRpcService; 20 import cn.fw.shirasawa.rpc.member.MemberRpcService;
21 import cn.fw.shirasawa.rpc.oop.OopService; 21 import cn.fw.shirasawa.rpc.oop.OopService;
22 import cn.fw.shirasawa.rpc.oop.dto.ShopDTO; 22 import cn.fw.shirasawa.rpc.oop.dto.ShopDTO;
23 -import cn.fw.shirasawa.service.data.*; 23 +import cn.fw.shirasawa.service.data.CluePoolService;
  24 +import cn.fw.shirasawa.service.data.FollowRecordService;
  25 +import cn.fw.shirasawa.service.data.FollowTaskService;
  26 +import cn.fw.shirasawa.service.data.SecretReportHistoryService;
24 import cn.hutool.core.date.BetweenFormater; 27 import cn.hutool.core.date.BetweenFormater;
25 import lombok.RequiredArgsConstructor; 28 import lombok.RequiredArgsConstructor;
26 import lombok.extern.slf4j.Slf4j; 29 import lombok.extern.slf4j.Slf4j;
@@ -46,11 +49,10 @@ public class PoolBizService { @@ -46,11 +49,10 @@ public class PoolBizService {
46 private final FollowTaskService followTaskService; 49 private final FollowTaskService followTaskService;
47 private final CluePoolService cluePoolService; 50 private final CluePoolService cluePoolService;
48 private final OopService oopService; 51 private final OopService oopService;
49 - private final UserService userService;  
50 private final MemberRpcService memberRpcService; 52 private final MemberRpcService memberRpcService;
51 private final SecretReportHistoryService secretReportHistoryService; 53 private final SecretReportHistoryService secretReportHistoryService;
52 private final FollowRecordService followRecordService; 54 private final FollowRecordService followRecordService;
53 - private final FollowRecordLogService followRecordLogService; 55 + private final EhrRpcService ehrRpcService;
54 56
55 57
56 /** 58 /**
@@ -170,7 +172,7 @@ public class PoolBizService { @@ -170,7 +172,7 @@ public class PoolBizService {
170 BeanUtils.copyProperties(poolDTO, vo); 172 BeanUtils.copyProperties(poolDTO, vo);
171 vo.setFollower(poolDTO.getFollowUserName()); 173 vo.setFollower(poolDTO.getFollowUserName());
172 if (StringUtils.isEmpty(poolDTO.getFollowUserName()) && Objects.nonNull(poolDTO.getUserId())) { 174 if (StringUtils.isEmpty(poolDTO.getFollowUserName()) && Objects.nonNull(poolDTO.getUserId())) {
173 - UserInfoDTO user = userService.user(poolDTO.getUserId()); 175 + UserInfoDTO user = ehrRpcService.user(poolDTO.getUserId());
174 if (Objects.nonNull(user)) { 176 if (Objects.nonNull(user)) {
175 vo.setFollower(user.getUserName()); 177 vo.setFollower(user.getUserName());
176 } 178 }
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/AbstractFollowStrategy.java
@@ -194,7 +194,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { @@ -194,7 +194,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
194 for (CluePool cluePool : cluePoolList) { 194 for (CluePool cluePool : cluePoolList) {
195 cluePool.setFinishShopId(taskCompleteDTO.getShopId()); 195 cluePool.setFinishShopId(taskCompleteDTO.getShopId());
196 cluePool.setFinishUserId(taskCompleteDTO.getUserId()); 196 cluePool.setFinishUserId(taskCompleteDTO.getUserId());
197 - UserInfoDTO user = userService.user(taskCompleteDTO.getUserId()); 197 + UserInfoDTO user = ehrRpcService.user(taskCompleteDTO.getUserId());
198 if (Objects.nonNull(user)) { 198 if (Objects.nonNull(user)) {
199 cluePool.setFinishUserName(user.getUserName()); 199 cluePool.setFinishUserName(user.getUserName());
200 } 200 }
@@ -695,7 +695,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { @@ -695,7 +695,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
695 */ 695 */
696 protected boolean dealRepeatClue(CluePool cluePool, FollowStrategy strategy) { 696 protected boolean dealRepeatClue(CluePool cluePool, FollowStrategy strategy) {
697 //判断是否可以去重 697 //判断是否可以去重
698 - if (null == cluePool.getCoverFlag() || Boolean.FALSE.equals(cluePool.getCoverFlag())) { 698 + if (!Boolean.TRUE.equals(cluePool.getCoverFlag())) {
699 return false; 699 return false;
700 } 700 }
701 boolean isContainAF = false; 701 boolean isContainAF = false;
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/SFFollowStrategy.java 0 → 100644
  1 +package cn.fw.shirasawa.service.bus.follow.strategy.impl;
  2 +
  3 +import cn.fw.shirasawa.domain.db.OriginalData;
  4 +import cn.fw.shirasawa.domain.db.follow.FollowRecord;
  5 +import cn.fw.shirasawa.domain.db.follow.FollowTask;
  6 +import cn.fw.shirasawa.domain.db.pool.CluePool;
  7 +import cn.fw.shirasawa.domain.enums.ClueStatusEnum;
  8 +import cn.fw.shirasawa.domain.enums.FollowTypeEnum;
  9 +import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy;
  10 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  11 +import lombok.Getter;
  12 +import lombok.extern.slf4j.Slf4j;
  13 +import org.springframework.beans.factory.annotation.Value;
  14 +import org.springframework.stereotype.Component;
  15 +import org.springframework.transaction.annotation.Transactional;
  16 +import org.springframework.util.CollectionUtils;
  17 +
  18 +import java.time.LocalDate;
  19 +import java.time.LocalDateTime;
  20 +import java.util.List;
  21 +import java.util.Objects;
  22 +import java.util.Optional;
  23 +
  24 +import static cn.fw.common.businessvalidator.Validator.BV;
  25 +
  26 +/**
  27 + * 补贴跟进
  28 + *
  29 + * @author : kurisu
  30 + * @version : 1.0
  31 + * @className : SFFollowStrategy
  32 + * @description : 补贴跟进
  33 + * @date : 2023-03-13 15:16
  34 + */
  35 +@Slf4j
  36 +@Component
  37 +@SuppressWarnings("Duplicates")
  38 +public class SFFollowStrategy extends AbstractFollowStrategy {
  39 + @Value("${follow.todo.SFCode}")
  40 + @Getter
  41 + private String SFCode;
  42 +
  43 + @Override
  44 + public FollowTypeEnum getFollowType() {
  45 + return FollowTypeEnum.SF;
  46 + }
  47 +
  48 + @Override
  49 + public String getTodoCode() {
  50 + return getSFCode();
  51 + }
  52 +
  53 + @Override
  54 + @Transactional(rollbackFor = Exception.class)
  55 + public boolean origin2task(OriginalData originalData) throws Exception {
  56 + List<CluePool> list = cluePoolService.list(Wrappers.<CluePool>lambdaQuery()
  57 + .eq(CluePool::getClueType, getFollowType())
  58 + .eq(CluePool::getCustomerId, originalData.getCustomerId())
  59 + .eq(CluePool::getRefererId, originalData.getDetailId())
  60 + .eq(CluePool::getGroupId, originalData.getGroupId())
  61 + .in(CluePool::getClueStatus, ClueStatusEnum.ONGOING, ClueStatusEnum.WAITING)
  62 + );
  63 + if (!CollectionUtils.isEmpty(list)) {
  64 + return true;
  65 + }
  66 + CluePool cluePool = transformClue(originalData);
  67 + cluePool.setStartTime(originalData.getGenerateTime());
  68 + LocalDateTime deadLine = Optional.ofNullable(originalData.getDeadline()).orElse(LocalDate.now().plusYears(10L).atStartOfDay());
  69 + cluePool.setDeadline(deadLine.minusSeconds(1L));
  70 + return cluePoolService.save(cluePool);
  71 + }
  72 +
  73 + @Override
  74 + @Transactional(rollbackFor = Exception.class)
  75 + public void startClue(CluePool cluePool) throws Exception {
  76 + dealRepeatClue(cluePool, this);
  77 + FollowTask task = this.createTask(cluePool);
  78 + boolean saveTask = followTaskService.save(task);
  79 + BV.isTrue(saveTask, () -> "生成跟进任务失败");
  80 + FollowRecord record = createRecord(task);
  81 + record.setTodoCode(getTodoCode());
  82 + record.setNote(cluePool.getNote());
  83 + record.setContacts(cluePool.getContacts());
  84 + if (Objects.nonNull(cluePool.getFirstDeadline())) {
  85 + record.setDeadline(cluePool.getFirstDeadline());
  86 + }
  87 + followRecordService.save(record);
  88 +
  89 + cluePool.setClueStatus(ClueStatusEnum.ONGOING);
  90 + cluePoolService.updateById(cluePool);
  91 + }
  92 +}
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <parent> 12 <parent>
13 <groupId>cn.fw</groupId> 13 <groupId>cn.fw</groupId>
14 <artifactId>fw-common-dependencies</artifactId> 14 <artifactId>fw-common-dependencies</artifactId>
15 - <version>3.3.0</version> 15 + <version>3.3.1</version>
16 </parent> 16 </parent>
17 17
18 <modules> 18 <modules>
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 <properties> 28 <properties>
29 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 29 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
30 <java.version>1.8</java.version> 30 <java.version>1.8</java.version>
31 - <fw.shirasawa.sdk>1.0.2</fw.shirasawa.sdk> 31 + <fw.shirasawa.sdk>1.0.3</fw.shirasawa.sdk>
32 <!-- util --> 32 <!-- util -->
33 <spring-retry.version>1.2.4.RELEASE</spring-retry.version> 33 <spring-retry.version>1.2.4.RELEASE</spring-retry.version>
34 <!-- database --> 34 <!-- database -->
@@ -222,6 +222,26 @@ @@ -222,6 +222,26 @@
222 <artifactId>lombok</artifactId> 222 <artifactId>lombok</artifactId>
223 <scope>provided</scope> 223 <scope>provided</scope>
224 </dependency> 224 </dependency>
  225 + <!-- kotlin -->
  226 + <dependency>
  227 + <groupId>org.jetbrains.kotlin</groupId>
  228 + <artifactId>kotlin-stdlib</artifactId>
  229 + <version>${kotlin.version}</version>
  230 + </dependency>
  231 + <dependency>
  232 + <groupId>org.jetbrains.kotlin</groupId>
  233 + <artifactId>kotlin-reflect</artifactId>
  234 + <version>${kotlin.version}</version>
  235 + </dependency>
  236 + <dependency>
  237 + <groupId>org.jetbrains.kotlin</groupId>
  238 + <artifactId>kotlin-stdlib-jdk8</artifactId>
  239 + <version>${kotlin.version}</version>
  240 + </dependency>
  241 + <dependency>
  242 + <groupId>com.fasterxml.jackson.module</groupId>
  243 + <artifactId>jackson-module-kotlin</artifactId>
  244 + </dependency>
225 <dependency> 245 <dependency>
226 <groupId>junit</groupId> 246 <groupId>junit</groupId>
227 <artifactId>junit</artifactId> 247 <artifactId>junit</artifactId>
@@ -232,6 +252,10 @@ @@ -232,6 +252,10 @@
232 <build> 252 <build>
233 <plugins> 253 <plugins>
234 <plugin> 254 <plugin>
  255 + <groupId>org.jetbrains.kotlin</groupId>
  256 + <artifactId>kotlin-maven-plugin</artifactId>
  257 + </plugin>
  258 + <plugin>
235 <groupId>org.apache.maven.plugins</groupId> 259 <groupId>org.apache.maven.plugins</groupId>
236 <artifactId>maven-compiler-plugin</artifactId> 260 <artifactId>maven-compiler-plugin</artifactId>
237 <configuration> 261 <configuration>
@@ -240,38 +264,30 @@ @@ -240,38 +264,30 @@
240 </configuration> 264 </configuration>
241 </plugin> 265 </plugin>
242 <plugin> 266 <plugin>
  267 + <groupId>org.apache.maven.plugins</groupId>
  268 + <artifactId>maven-deploy-plugin</artifactId>
  269 + <configuration>
  270 + <skip>true</skip>
  271 + </configuration>
  272 + </plugin>
  273 + <plugin>
243 <groupId>org.codehaus.mojo</groupId> 274 <groupId>org.codehaus.mojo</groupId>
244 <artifactId>versions-maven-plugin</artifactId> 275 <artifactId>versions-maven-plugin</artifactId>
245 </plugin> 276 </plugin>
246 </plugins> 277 </plugins>
247 </build> 278 </build>
248 279
249 - <repositories>  
250 - <repository>  
251 - <id>feewee-maven-public</id>  
252 - <name>feewee maven public</name>  
253 - <url>http://nexus.feewee.cn/nexus/content/groups/public/</url>  
254 - <releases>  
255 - <enabled>true</enabled>  
256 - <updatePolicy>always</updatePolicy>  
257 - </releases>  
258 - <snapshots>  
259 - <enabled>true</enabled>  
260 - <updatePolicy>always</updatePolicy>  
261 - </snapshots>  
262 - </repository>  
263 - </repositories>  
264 280
265 <distributionManagement> 281 <distributionManagement>
266 <repository> 282 <repository>
267 <id>feewee-maven-releases</id> 283 <id>feewee-maven-releases</id>
268 <name>Nexus Release Repository</name> 284 <name>Nexus Release Repository</name>
269 - <url>http://nexus.feewee.cn/nexus/content/repositories/releases/</url> 285 + <url>https://nexus.feewee.cn/nexus/content/repositories/releases/</url>
270 </repository> 286 </repository>
271 <snapshotRepository> 287 <snapshotRepository>
272 <id>feewee-maven-snapshots</id> 288 <id>feewee-maven-snapshots</id>
273 <name>Nexus Snapshot Repository</name> 289 <name>Nexus Snapshot Repository</name>
274 - <url>http://nexus.feewee.cn/nexus/content/repositories/snapshots/</url> 290 + <url>https://nexus.feewee.cn/nexus/content/repositories/snapshots/</url>
275 <uniqueVersion>true</uniqueVersion> 291 <uniqueVersion>true</uniqueVersion>
276 </snapshotRepository> 292 </snapshotRepository>
277 </distributionManagement> 293 </distributionManagement>