tao.mo

manager-server | 修改 |

FCL登录获取ean信息
mt
2025年5月27日17:10:40
...@@ -16,6 +16,12 @@ public class PropertiesConfig { ...@@ -16,6 +16,12 @@ public class PropertiesConfig {
16 @Value("${fcl.interface.userinfo}") 16 @Value("${fcl.interface.userinfo}")
17 private String userInfoUrl; 17 private String userInfoUrl;
18 18
19 + @Value("${fcl.interface.account}")
20 + private String userAccountUrl;
21 +
22 + @Value("${fcl.interface.shippingaccounts}")
23 + private String userShippingaccountsUrl;
24 +
19 @Value("${fcl.login.redjrectLogin}") 25 @Value("${fcl.login.redjrectLogin}")
20 private String redjrectLogin; 26 private String redjrectLogin;
21 27
......
...@@ -140,6 +140,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl ...@@ -140,6 +140,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl
140 if (loginUser == null){ 140 if (loginUser == null){
141 //如果用户不存在,则创建FCL用户信息 141 //如果用户不存在,则创建FCL用户信息
142 SysUserDto dto = new SysUserDto(fcl_uuid, fcl_contactname); 142 SysUserDto dto = new SysUserDto(fcl_uuid, fcl_contactname);
143 + sysUserService.initUserInfo(fclInfoDto,dto);
143 loginUser = sysUserService.save(dto); 144 loginUser = sysUserService.save(dto);
144 } else { 145 } else {
145 //首先对用户中的姓名进行解密 146 //首先对用户中的姓名进行解密
...@@ -158,6 +159,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl ...@@ -158,6 +159,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl
158 loginUser.setUserName(StringUtils.trimToEmpty(fcl_contactname)); 159 loginUser.setUserName(StringUtils.trimToEmpty(fcl_contactname));
159 } 160 }
160 loginUser.setModifyTime(new Date()); 161 loginUser.setModifyTime(new Date());
162 + sysUserService.initUserInfo(fclInfoDto,loginUser);
161 sysUserService.update(loginUser); 163 sysUserService.update(loginUser);
162 } 164 }
163 } 165 }
......
...@@ -18,7 +18,9 @@ public class FclInfoDto { ...@@ -18,7 +18,9 @@ public class FclInfoDto {
18 //用户名称 18 //用户名称
19 String fclContactname; 19 String fclContactname;
20 //用户登录账号 20 //用户登录账号
21 - private String userId; 21 + String userId;
22 //用户邮箱 22 //用户邮箱
23 - private String emailAddress; 23 + String emailAddress;
24 + //用户计费账号
25 + String shipperAccounts;
24 } 26 }
......
1 +package com.fedex.connect.manager.data.vo;
2 +
3 +import lombok.Data;
4 +
5 +@Data
6 +public class EanTwoVo {
7 + private String defaultEanInfo;
8 + private String accountNumberInfo;
9 +}
1 +package com.fedex.connect.manager.data.vo;
2 +
3 +
4 +import lombok.Data;
5 +
6 +import java.io.Serializable;
7 +import java.util.List;
8 +
9 +/**
10 + * @Author mt
11 + * @Description FCL接口获取用户信息-响应数据对象
12 + * @Date 2025/5/27
13 + */
14 +@Data
15 +public class FCLAccountsResponseVo implements Serializable {
16 +
17 + private String transactionId;
18 + private OutPut output;
19 +
20 + @Data
21 + public static class OutPut implements Serializable{
22 + List<FCLCustomerAccount> customerAccountList;
23 + }
24 +
25 + @Data
26 + public static class FCLCustomerAccount implements Serializable{
27 + private Account account;
28 + private List<ActiveAppRoleInfo> activeAppRoleInfos;
29 + }
30 +
31 + /**
32 + * 账号信息
33 + */
34 + @Data
35 + public static class Account implements Serializable{
36 + private AccountIdentifier accountIdentifier;
37 + }
38 + @Data
39 + public static class ActiveAppRoleInfo implements Serializable{
40 + private String appName;
41 + private String roleCode;
42 + private Integer roleLevelCode;
43 + }
44 + @Data
45 + public static class AccountIdentifier implements Serializable{
46 + /**
47 + * 账号对应EAN信息
48 + */
49 + private AccountNumber accountNumber;
50 + private String accountNickname;
51 + private String displayName;
52 + private Boolean meterNumberAvailable;
53 + }
54 + @Data
55 + public static class AccountNumber implements Serializable{
56 + private String value;
57 + private String key;
58 + }
59 +}
60 +
...@@ -3,8 +3,10 @@ package com.fedex.connect.manager.data.vo; ...@@ -3,8 +3,10 @@ package com.fedex.connect.manager.data.vo;
3 import lombok.Data; 3 import lombok.Data;
4 4
5 /** 5 /**
6 - * FCL接口获取token响应对象 6 + * @Author mt
7 - */ 7 + * @Description FCL接口获取token响应对象
8 + * @Date 2025/5/27
9 + */
8 @Data 10 @Data
9 public class FCLTokenResponseVo { 11 public class FCLTokenResponseVo {
10 12
......
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
13 * @Date 2025/5/26 13 * @Date 2025/5/26
14 */ 14 */
15 @Data 15 @Data
16 -public class FCLUserInfoVo implements Serializable { 16 +public class FCLUserInfoResponseVo implements Serializable {
17 17
18 private String transactionId; 18 private String transactionId;
19 private OutPut output; 19 private OutPut output;
......
1 +package com.fedex.connect.manager.data.vo;
2 +
3 +import lombok.Data;
4 +
5 +import java.io.Serializable;
6 +import java.util.List;
7 +
8 +@Data
9 +public class FclEanTwoResponseVo implements Serializable{
10 +
11 + private String transactionId;
12 + private Output output;
13 +
14 + @Data
15 + public static class Output implements Serializable {
16 +
17 + private Boolean success;
18 + private List<AccountInfoVO> accountInfoVOs;
19 + }
20 +
21 + @Data
22 + public static class AccountInfoVO implements Serializable {
23 +
24 + private DefaultAccount defaultAccount;
25 + private List<AssociatedAccount> associatedAccountList;
26 + }
27 +
28 + @Data
29 + public static class DefaultAccount implements Serializable {
30 +
31 + private String value;
32 + private String key;
33 + }
34 +
35 + @Data
36 + public static class AssociatedAccount implements Serializable {
37 +
38 + private AccountNumber accountNumber;
39 + private String accountNickname;
40 + private String accountDisplayName;
41 + }
42 +
43 + @Data
44 + public static class AccountNumber implements Serializable {
45 +
46 + private String value;
47 + private String key;
48 + }
49 +}
...@@ -2,6 +2,7 @@ package com.fedex.connect.manager.service.sys; ...@@ -2,6 +2,7 @@ package com.fedex.connect.manager.service.sys;
2 2
3 import com.fedex.connect.common.model.sys.User; 3 import com.fedex.connect.common.model.sys.User;
4 import com.fedex.connect.manager.data.bo.AddFlagBo; 4 import com.fedex.connect.manager.data.bo.AddFlagBo;
5 +import com.fedex.connect.manager.data.dto.FclInfoDto;
5 import com.fedex.connect.manager.data.dto.SysUserDto; 6 import com.fedex.connect.manager.data.dto.SysUserDto;
6 7
7 import javax.servlet.http.HttpServletRequest; 8 import javax.servlet.http.HttpServletRequest;
...@@ -19,4 +20,24 @@ public interface ISysUserService { ...@@ -19,4 +20,24 @@ public interface ISysUserService {
19 User findById(Long id); 20 User findById(Long id);
20 21
21 void updateAddFlag(User user, AddFlagBo bo); 22 void updateAddFlag(User user, AddFlagBo bo);
23 +
24 + /**
25 + * @Author mt
26 + * @Description 构造用户信息
27 + * @Date 2025/5/27
28 + * @param fclInfoDto
29 + * @param loginUser
30 + * @return void
31 + */
32 + void initUserInfo(FclInfoDto fclInfoDto,SysUserDto loginUser);
33 +
34 + /**
35 + * @Author mt
36 + * @Description 构造用户信息
37 + * @Date 2025/5/27
38 + * @param fclInfoDto
39 + * @param loginUser
40 + * @return void
41 + */
42 + void initUserInfo(FclInfoDto fclInfoDto, User loginUser);
22 } 43 }
......
...@@ -12,6 +12,7 @@ import com.fedex.connect.common.model.sys.User; ...@@ -12,6 +12,7 @@ import com.fedex.connect.common.model.sys.User;
12 import com.fedex.connect.common.model.sys.UserExample; 12 import com.fedex.connect.common.model.sys.UserExample;
13 import com.fedex.connect.manager.config.PropertiesConfig; 13 import com.fedex.connect.manager.config.PropertiesConfig;
14 import com.fedex.connect.manager.data.bo.AddFlagBo; 14 import com.fedex.connect.manager.data.bo.AddFlagBo;
15 +import com.fedex.connect.manager.data.dto.FclInfoDto;
15 import com.fedex.connect.manager.data.dto.SysUserDto; 16 import com.fedex.connect.manager.data.dto.SysUserDto;
16 import com.fedex.connect.manager.data.model.LogShowModel; 17 import com.fedex.connect.manager.data.model.LogShowModel;
17 import com.fedex.connect.manager.service.base.BaseService; 18 import com.fedex.connect.manager.service.base.BaseService;
...@@ -216,5 +217,43 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService { ...@@ -216,5 +217,43 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService {
216 userRepository.updateByPrimaryKeySelective(user); 217 userRepository.updateByPrimaryKeySelective(user);
217 } 218 }
218 219
220 + /**
221 + * @Author mt
222 + * @Description 构造用户信息
223 + * @Date 2025/5/27
224 + * @param fclInfoDto
225 + * @param loginUser
226 + * @return void
227 + */
228 + public void initUserInfo(FclInfoDto fclInfoDto,SysUserDto loginUser){
229 + if (StringUtils.isNotEmpty(fclInfoDto.getUserId())){
230 + loginUser.setLoginName(fclInfoDto.getUserId());
231 + }
232 + if(StringUtils.isNotEmpty(fclInfoDto.getEmailAddress())){
233 + loginUser.setEmail(fclInfoDto.getEmailAddress());
234 + }
235 + if(StringUtils.isNotEmpty(fclInfoDto.getShipperAccounts())){
236 + loginUser.setAccountNo(fclInfoDto.getShipperAccounts());
237 + }
238 + }
219 239
240 + /**
241 + * @Author mt
242 + * @Description 构造用户信息
243 + * @Date 2025/5/27
244 + * @param fclInfoDto
245 + * @param loginUser
246 + * @return void
247 + */
248 + public void initUserInfo(FclInfoDto fclInfoDto,User loginUser){
249 + if (StringUtils.isNotEmpty(fclInfoDto.getUserId())){
250 + loginUser.setLoginName(fclInfoDto.getUserId());
251 + }
252 + if(StringUtils.isNotEmpty(fclInfoDto.getEmailAddress())){
253 + loginUser.setEmail(fclInfoDto.getEmailAddress());
254 + }
255 + if(StringUtils.isNotEmpty(fclInfoDto.getShipperAccounts())){
256 + loginUser.setAccountNo(fclInfoDto.getShipperAccounts());
257 + }
258 + }
220 } 259 }
......
...@@ -47,5 +47,7 @@ fcl: ...@@ -47,5 +47,7 @@ fcl:
47 scope: oob 47 scope: oob
48 account: 48 account:
49 url: /user/v2/accounts 49 url: /user/v2/accounts
50 + shippingaccounts:
51 + url: /administration/v1/users/shippingaccounts
50 userinfo: 52 userinfo:
51 url: /user/v2/users/userinfo 53 url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -40,5 +40,7 @@ fcl: ...@@ -40,5 +40,7 @@ fcl:
40 scope: oob 40 scope: oob
41 account: 41 account:
42 url: /user/v2/accounts 42 url: /user/v2/accounts
43 + shippingaccounts:
44 + url: /administration/v1/users/shippingaccounts
43 userinfo: 45 userinfo:
44 url: /user/v2/users/userinfo 46 url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -41,5 +41,7 @@ fcl: ...@@ -41,5 +41,7 @@ fcl:
41 scope: oob 41 scope: oob
42 account: 42 account:
43 url: /user/v2/accounts 43 url: /user/v2/accounts
44 + shippingaccounts:
45 + url: /administration/v1/users/shippingaccounts
44 userinfo: 46 userinfo:
45 url: /user/v2/users/userinfo 47 url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -40,5 +40,7 @@ fcl: ...@@ -40,5 +40,7 @@ fcl:
40 scope: oob 40 scope: oob
41 account: 41 account:
42 url: /user/v2/accounts 42 url: /user/v2/accounts
43 + shippingaccounts:
44 + url: /administration/v1/users/shippingaccounts
43 userinfo: 45 userinfo:
44 url: /user/v2/users/userinfo 46 url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
......