Commit 844f64a399ed3860a8993ca75f67900242dcee71

Authored by 张志伟
1 parent 26db1863

:zap: feature(*): 升级依赖

- 升级依赖引入kotlin支持
- 切换人员信息查询使用ehr接口
fw-shirasawa-common/pom.xml
... ... @@ -58,15 +58,4 @@
58 58 </dependency>
59 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 61 </project>
73 62 \ No newline at end of file
... ...
fw-shirasawa-dao/pom.xml
... ... @@ -34,16 +34,4 @@
34 34 <artifactId>fw-shirasawa-common</artifactId>
35 35 </dependency>
36 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 37 </project>
50 38 \ No newline at end of file
... ...
fw-shirasawa-domain/pom.xml
... ... @@ -35,16 +35,4 @@
35 35 <artifactId>fw-shirasawa-sdk</artifactId>
36 36 </dependency>
37 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 38 </project>
51 39 \ No newline at end of file
... ...
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 import cn.fw.shirasawa.common.utils.StringUtils;
7 7 import cn.fw.shirasawa.rpc.AbsBaseRpcService;
8 8 import cn.fw.shirasawa.rpc.ehr.dto.StaffInfoDTO;
  9 +import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO;
9 10 import com.alibaba.fastjson.JSONObject;
10 11 import lombok.extern.slf4j.Slf4j;
11 12 import org.springframework.beans.BeanUtils;
... ... @@ -37,6 +38,22 @@ public class EhrRpcService extends AbsBaseRpcService {
37 38 }
38 39  
39 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 57 public StaffInfoDTO queryStaffInfo(final Long userId) {
41 58 if (userId == null) {
42 59 return null;
... ...
fw-shirasawa-rpc/src/main/java/cn/fw/shirasawa/rpc/erp/UserService.java
1 1 package cn.fw.shirasawa.rpc.erp;
2 2  
3 3 import cn.fw.data.base.domain.common.Message;
4   -import cn.fw.erp.sdk.api.UserApi;
5 4 import cn.fw.erp.sdk.api.UserRoleApi;
6   -import cn.fw.erp.sdk.api.result.UserBaseInfo;
7 5 import cn.fw.erp.sdk.api.result.UserRoleDataRange;
8 6 import cn.fw.erp.sdk.api.result.UserRoleInfo;
9   -import cn.fw.shirasawa.common.utils.StringUtils;
10 7 import cn.fw.shirasawa.rpc.AbsBaseRpcService;
11 8 import cn.fw.shirasawa.rpc.erp.dto.PostUserDTO;
12   -import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO;
13 9 import cn.fw.shirasawa.rpc.erp.dto.UserRoleDataRangeDTO;
14 10 import com.alibaba.fastjson.JSONObject;
15 11 import lombok.Getter;
... ... @@ -26,10 +22,6 @@ import java.util.Collections;
26 22 import java.util.List;
27 23 import java.util.Objects;
28 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 35 @RequiredArgsConstructor
44 36 public class UserService extends AbsBaseRpcService {
45 37 /**
46   - * 用户服务
47   - */
48   - private final UserApi userApi;
49   - /**
50 38 * 岗位用户服务
51 39 */
52 40 private final UserRoleApi userRoleApi;
... ... @@ -56,83 +44,6 @@ public class UserService extends AbsBaseRpcService {
56 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 49 * @param userId
... ...
fw-shirasawa-sdk/pom.xml
... ... @@ -57,6 +57,13 @@
57 57 </execution>
58 58 </executions>
59 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 67 </plugins>
61 68 </build>
62 69 </project>
63 70 \ No newline at end of file
... ...
fw-shirasawa-server/pom.xml
... ... @@ -149,13 +149,6 @@
149 149 <executable>true</executable>
150 150 </configuration>
151 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 152 </plugins>
160 153 </build>
161 154  
... ...
fw-shirasawa-service/pom.xml
... ... @@ -117,15 +117,4 @@
117 117 <artifactId>fw-dfs-sdk</artifactId>
118 118 </dependency>
119 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 120 </project>
132 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 15 import cn.fw.shirasawa.domain.vo.pool.CluePoolVO;
16 16 import cn.fw.shirasawa.domain.vo.pool.FollowPoolListVO;
17 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 19 import cn.fw.shirasawa.rpc.erp.dto.UserInfoDTO;
20 20 import cn.fw.shirasawa.rpc.member.MemberRpcService;
21 21 import cn.fw.shirasawa.rpc.oop.OopService;
22 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 27 import cn.hutool.core.date.BetweenFormater;
25 28 import lombok.RequiredArgsConstructor;
26 29 import lombok.extern.slf4j.Slf4j;
... ... @@ -46,11 +49,10 @@ public class PoolBizService {
46 49 private final FollowTaskService followTaskService;
47 50 private final CluePoolService cluePoolService;
48 51 private final OopService oopService;
49   - private final UserService userService;
50 52 private final MemberRpcService memberRpcService;
51 53 private final SecretReportHistoryService secretReportHistoryService;
52 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 172 BeanUtils.copyProperties(poolDTO, vo);
171 173 vo.setFollower(poolDTO.getFollowUserName());
172 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 176 if (Objects.nonNull(user)) {
175 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 194 for (CluePool cluePool : cluePoolList) {
195 195 cluePool.setFinishShopId(taskCompleteDTO.getShopId());
196 196 cluePool.setFinishUserId(taskCompleteDTO.getUserId());
197   - UserInfoDTO user = userService.user(taskCompleteDTO.getUserId());
  197 + UserInfoDTO user = ehrRpcService.user(taskCompleteDTO.getUserId());
198 198 if (Objects.nonNull(user)) {
199 199 cluePool.setFinishUserName(user.getUserName());
200 200 }
... ...
... ... @@ -12,7 +12,7 @@
12 12 <parent>
13 13 <groupId>cn.fw</groupId>
14 14 <artifactId>fw-common-dependencies</artifactId>
15   - <version>3.3.0</version>
  15 + <version>3.3.1</version>
16 16 </parent>
17 17  
18 18 <modules>
... ... @@ -222,6 +222,26 @@
222 222 <artifactId>lombok</artifactId>
223 223 <scope>provided</scope>
224 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 245 <dependency>
226 246 <groupId>junit</groupId>
227 247 <artifactId>junit</artifactId>
... ... @@ -232,6 +252,10 @@
232 252 <build>
233 253 <plugins>
234 254 <plugin>
  255 + <groupId>org.jetbrains.kotlin</groupId>
  256 + <artifactId>kotlin-maven-plugin</artifactId>
  257 + </plugin>
  258 + <plugin>
235 259 <groupId>org.apache.maven.plugins</groupId>
236 260 <artifactId>maven-compiler-plugin</artifactId>
237 261 <configuration>
... ... @@ -240,38 +264,30 @@
240 264 </configuration>
241 265 </plugin>
242 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 274 <groupId>org.codehaus.mojo</groupId>
244 275 <artifactId>versions-maven-plugin</artifactId>
245 276 </plugin>
246 277 </plugins>
247 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 281 <distributionManagement>
266 282 <repository>
267 283 <id>feewee-maven-releases</id>
268 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 286 </repository>
271 287 <snapshotRepository>
272 288 <id>feewee-maven-snapshots</id>
273 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 291 <uniqueVersion>true</uniqueVersion>
276 292 </snapshotRepository>
277 293 </distributionManagement>
... ...