Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a5df19af
authored
Nov 24, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
2 parents
32bac8a1
24343f24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
25 deletions
project-order/src/main/java/com/dituhui/pea/order/feign/IBeanRemoteService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BeanRemoteServiceImpl.java
project-order/src/main/resources/application.yaml
project-order/src/main/java/com/dituhui/pea/order/feign/IBeanRemoteService.java
View file @
a5df19a
...
@@ -58,7 +58,7 @@ public interface IBeanRemoteService {
...
@@ -58,7 +58,7 @@ public interface IBeanRemoteService {
* 查询BEAN账号详情
* 查询BEAN账号详情
*
*
* @param accessToken ACCESS_TOKEN
* @param accessToken ACCESS_TOKEN
* @param workNo
账号中心ID
* @param workNo
hrId
* @return 人员详情信息
* @return 人员详情信息
* @apiNote 根据账号ID(账号中心ID)从BEAN查询账号详情,包括账号姓名、联系方式、所属部门、技能资质等信息
* @apiNote 根据账号ID(账号中心ID)从BEAN查询账号详情,包括账号姓名、联系方式、所属部门、技能资质等信息
*/
*/
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BeanRemoteServiceImpl.java
View file @
a5df19a
...
@@ -192,29 +192,42 @@ public class BeanRemoteServiceImpl {
...
@@ -192,29 +192,42 @@ public class BeanRemoteServiceImpl {
for
(
BeanAccountInfo
account
:
userlist
)
{
for
(
BeanAccountInfo
account
:
userlist
)
{
log
.
info
(
"开始同步人员信息{}"
,
JsonUtil
.
toJson
(
account
));
log
.
info
(
"开始同步人员信息{}"
,
JsonUtil
.
toJson
(
account
));
BeanR
<
BeanUserDetail
>
beanUserDetailBeanR
=
beanRemoteService
.
userDetail
(
getAccessToken
(),
account
.
getHrId
());
saveEngineerInfoByHrId
(
departId
,
account
.
getHrId
(),
account
.
getUserName
());
log
.
info
(
"[查询BEAN用户详情]【/api/openapi/user/queryDetail】返回值-------------------->{}"
,
JsonUtil
.
toJson
(
beanUserDetailBeanR
));
}
BeanUserDetail
userDetailInfo
=
beanUserDetailBeanR
.
getData
();
}
if
(!
beanUserDetailBeanR
.
getSuccess
()
||
Objects
.
isNull
(
userDetailInfo
))
{
log
.
error
(
"用户详情列表未获取到用户:{}-{}的详细信息 , 错误信息:{}"
,
account
.
getUserName
(),
account
.
getCenterId
(),
beanUserDetailBeanR
.
getMessage
());
/**
continue
;
* 根据hrId 获取BEAN自有账户(工程师)详情,并存储工程师基本信息和业务信息, (会自动忽略不存在工号的账户信息- 库里如果已有相关账户会被覆盖)
}
*
String
engineerCode
=
userDetailInfo
.
getWorkNo
();
* @param departId 部门ID, (这里只能传分部)
if
(
StringUtils
.
isBlank
(
engineerCode
))
{
* @param hrId bean 用户列表接口提供的 hrId
log
.
warn
(
"分站:{}工程师{}没有工号"
,
departId
,
userDetailInfo
.
getUsername
());
* @param userName 用户名
continue
;
*/
}
public
void
saveEngineerInfoByHrId
(
String
departId
,
String
hrId
,
String
userName
)
{
final
Address
address
=
userDetailInfo
.
getAddress
();
BeanR
<
BeanUserDetail
>
beanUserDetailBeanR
=
beanRemoteService
.
userDetail
(
getAccessToken
(),
hrId
);
//fixme 正式同步需移除当前逻辑
log
.
info
(
"[查询BEAN用户详情]【/api/openapi/user/queryDetail】返回值-------------------->{}"
,
JsonUtil
.
toJson
(
beanUserDetailBeanR
));
engineerCode
=
"BEAN"
+
engineerCode
;
BeanUserDetail
userDetailInfo
=
beanUserDetailBeanR
.
getData
();
EngineerInfoEntity
engineerInfo
=
getEngineerInfoEntity
(
departId
,
engineerCode
,
userDetailInfo
,
address
);
if
(!
beanUserDetailBeanR
.
getSuccess
()
||
Objects
.
isNull
(
userDetailInfo
))
{
engineerInfoDao
.
save
(
engineerInfo
);
log
.
error
(
"用户详情列表未获取到用户:{}-{}的详细信息 , 错误信息:{}"
,
userName
,
hrId
,
beanUserDetailBeanR
.
getMessage
());
engineerInfoDao
.
flush
();
return
;
//保存业务属性信息--常用出发地信息
}
EngineerBusinessEntity
engineerBusiness
=
getEngineerBusiness
(
engineerCode
,
address
);
String
engineerCode
=
userDetailInfo
.
getWorkNo
();
if
(
engineerBusiness
==
null
){
continue
;}
if
(
StringUtils
.
isBlank
(
engineerCode
))
{
engineerBusinessDao
.
save
(
engineerBusiness
);
log
.
warn
(
"分站:{}工程师{}没有工号"
,
departId
,
userDetailInfo
.
getUsername
());
return
;
}
final
Address
address
=
userDetailInfo
.
getAddress
();
//fixme 正式同步需移除当前逻辑
engineerCode
=
"BEAN"
+
engineerCode
;
EngineerInfoEntity
engineerInfo
=
getEngineerInfoEntity
(
departId
,
engineerCode
,
userDetailInfo
,
address
);
engineerInfoDao
.
save
(
engineerInfo
);
engineerInfoDao
.
flush
();
//保存业务属性信息--常用出发地信息
EngineerBusinessEntity
engineerBusiness
=
getEngineerBusiness
(
engineerCode
,
address
);
if
(
engineerBusiness
==
null
)
{
return
;
}
}
engineerBusinessDao
.
save
(
engineerBusiness
);
}
}
private
EngineerInfoEntity
getEngineerInfoEntity
(
String
departId
,
String
engineerCode
,
BeanUserDetail
userDetailInfo
,
Address
address
)
{
private
EngineerInfoEntity
getEngineerInfoEntity
(
String
departId
,
String
engineerCode
,
BeanUserDetail
userDetailInfo
,
Address
address
)
{
...
...
project-order/src/main/resources/application.yaml
View file @
a5df19a
...
@@ -86,8 +86,8 @@ scheduler:
...
@@ -86,8 +86,8 @@ scheduler:
day-offset-end
:
20
day-offset-end
:
20
calc-org-capacity
:
calc-org-capacity
:
#
8-20点,每小时1次
#
每小时两次, 分别于10分以及 40分执行
cron-expr
:
0
0 1-23
* * ?
cron-expr
:
0
10,40 *
* * ?
day-offset-begin
:
0
day-offset-begin
:
0
day-offset-end
:
20
day-offset-end
:
20
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment